Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: raffle_tickets_generator

by GotToBTru (Prior)
on Dec 04, 2015 at 14:01 UTC ( #1149384=note: print w/replies, xml ) Need Help??


in reply to Re^2: raffle_tickets_generator
in thread raffle_tickets_generator

Good reference that talks about paragraph mode.

use strict; use warnings; my ($first,$second,$third); { local $/ = ''; ($first, $second, $third) = <DATA>; } printf "First: %s", $first; printf "Second: %s", $second; printf "Third: %s", $third; __DATA__ this will go into the variable called first second here tail end charlie
Dum Spiro Spero

Replies are listed 'Best First'.
Re^4: raffle_tickets_generator
by QuillMeantTen (Friar) on Dec 05, 2015 at 10:18 UTC

    Just to be sure I get it, when you localise $/ as '' perl will see an empty line as the record separator? even if said empty line is actually just one '\n' character.

    I understand that making $/ equal '\n' you would have ended up with

    $first = "this will"; $second="go into the variable"; $third = "called first";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-07-02 05:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (102 votes). Check out past polls.

    Notices?