A Perl script catalogs books and CDs with the help of barcodes
To allow the Tk toolkit's photo widget to read and display JPEG images, line 8 loads the Tk::JPEG module, which is also part of the Tk distribution. The img_display() function defined in line 158ff. expects the URL for an image hosted by Amazon.com and then asks the POE-friendly user agent to retrieve it.
Because the Tk photo widget insists on Base64-encoded data (at least for JPEGs), the encode_base64() function from the MIME::Base64 module converts the JPEG data extracted via content() into a format that the widget will handle. After this, the photo widget's configure() method sets the -data option, which in turn tells the widget to parse the data, convert it to the internal Tk format, and display the decoded image in the GUI.
Database with Wrappers
Now back to the resp_process() function: It not only displays the product data, but also stores it in the database. To allow this to happen, in line 128 the Rose::DB wrapper creates a new Article type object and sets the object's upc, type, title, and bywho fields, which all correspond to the database table columns with the same names.
The load() method with the speculative attribute then attempts to find a matching entry in the database. If the search succeeds, the script sends an "ALREADY EXISTS" message to the GUI display to tell the operator that this product has already been scanned. If load() fails, save() in line 149 saves the newly entered article in the database.
Before the script can use AWS, you must apply for an Amazon developer token and enter it in line 89. This process is fast, and you can trigger it  by entering a valid email address to which the token will be sent. Without a valid token, the script will say NOT FOUND every time. The database is created by the SQLite client sqlite3 when the schema file (Figure 6) is passed in to it:
sqlite3 articles.dat <schema.sql
The client then creates the articles.dat database and an empty database table, articles, containing the columns id, upc (the UPC/EAN code), type (Books, Music, or DVD), title (the title of the book or CD/DVD), and bywho (the author or artist).
The UNIQUE command in the database table's SQL uses the article type and UPC number as unique keys to allow the Rose database wrapper to run load() quickly and check to see whether the product with a given UPC and type has already been scanned.
Buy this article as PDF
New release targets Linux professionals.
The Fedora project adds Wayland and Gnome 3.22
CeBIT 2017: Open Source Forum Call for Papers
Long-time Linux antagonist joins the revolution.
Major bug affects Debian/Ubuntu distributions.
Canonical releases the minimal edition for embedded devices, Internet of Things, and cloud deployments.
The new release features improvements across the board, from performance to security.
Two out of three of the new members are women.
More than 5,000 people attended the event.
Linux Magazine will include the best of both magazines.