Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: print last array element without a new line

by onegative (Scribe)
on Oct 19, 2011 at 20:14 UTC ( #932492=note: print w/replies, xml ) Need Help??


in reply to Re^2: print last array element without a new line
in thread print last array element without a new line

Look at http://www.perlmonks.org/?node_id=791664
  • Comment on Re^3: print last array element without a new line

Replies are listed 'Best First'.
Re^4: print last array element without a new line
by ikegami (Pope) on Oct 19, 2011 at 23:02 UTC

    That means you had a carriage return in the middle of the line.

    A better solution would be to change

    chomp(my $record = $_);
    to
    s/\r?\n//; my $record = $_;
    or even
    s/\s+\z//; my $record = $_;
Re^4: print last array element without a new line
by sy (Initiate) on Oct 19, 2011 at 21:05 UTC
    Thank you kindly! That was it. One of my files was from a distinct source (CSV export from Apple Numbers) and hence had a different line separator. Changing the local definition of $/ fixed the problem. Thanks so much for your help!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932492]
help
Chatterbox?
[Corion]: Mhhmmm - https://sod.pixlab .io/ looks really interesting for embedding with Perl (XS), but they don't have any kind of free model available and the cheapest pretrained model costs EUR 40 :-(
[Corion]: Maybe I should mail them to find out if they can provide me a "hotdog / no hotdog" model for developping the XS bindings. It would be nice to have a self-contained XS library for applying models to data. Or maybe I should look at TensorFlow, which can...
[Corion]: ... at least be trained by me, instead of relying on a vendor
[Discipulus]: complex and interesting
[Corion]: Discipulus: My hope would be that you can install the module from CPAN, download a model, and get image descriptions/ object detection within half a day, which would be great :)

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2018-06-18 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (109 votes). Check out past polls.

    Notices?