Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: $/ usage

by ww (Bishop)
on Jan 02, 2013 at 21:38 UTC ( #1011356=note: print w/ replies, xml ) Need Help??


in reply to $/ usage

I can think of only two reasons why you "can't do this from the commandline" - one is that the file name you're supplying does NOT exist or does not exist where you think it does -- is, in the directory from which you're executing your code.

The other is that you're on a windows box and need to fix your quotes.

List.txt for use with 1011347 server1 ipaddress server2 ipaddress server3 ipaddress D:\> perl -E "undef $/; $text=<>; print $text; $/=\"\n\";" List.txt

Works for me (the oneliner is as revised for use on the windows box most readily available):

D:\>perl -E "undef $/; $text=<>; print $text; $/=\"\n\";" List.txt

Source file as output by code above

List.txt for use with 1011347 server1 ipaddress server2 ipaddress server3 ipaddress D:\> perl -E "undef $/; $text=<>; print $text; $/=\"\n\";" List.txt D:\>

Or, I suppose, a third possible cause of failure would amount to both the above.   :)


Comment on Re: $/ usage
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-07-08 00:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls