Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: putting commas separated values into a new file line by line

by Anonymous Monk
on Aug 11, 2020 at 16:58 UTC ( [id://11120616]=note: print w/replies, xml ) Need Help??


in reply to Re: putting commas separated values into a new file line by line
in thread putting commas separated values into a new file line by line

i don't understood completely, i just want to have those command line passed values that are further stored under $runTest in a new file as line by line

got below error while running the script

Bareword found where operator expected at ./fileTest.pl line 10, near "tr/,/\n/r"

syntax error at ./fileTest.pl line 10, near "tr/,/\n/r"

  • Comment on Re^2: putting commas separated values into a new file line by line

Replies are listed 'Best First'.
Re^3: putting commas separated values into a new file line by line
by choroba (Cardinal) on Aug 11, 2020 at 17:03 UTC
    What Perl version are you using?

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      perl v5.10.1
        You are 11 years behind. The /r needs 5.14, without it, you need to do
        my $runTest = 'sydney,delhi,NY,Russia'; (my $lines = $runTest) =~ tr/,/\n/; print {$out} $lines;
        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11120616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 07:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found