Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: "use strict" and formats

by Joost (Canon)
on Mar 24, 2005 at 21:39 UTC ( #442203=note: print w/ replies, xml ) Need Help??


in reply to "use strict" and formats

$~ should be set to the name of the format:

#!/usr/bin/perl -w use strict; my $text1 = "A"; my $text2 = "B"; format COLUMNS = @<<<<<<@>>>>>>> $text1,$text2 . $~ = "COLUMNS"; # note the quotes write;


Comment on Re: "use strict" and formats
Download Code
Re^2: "use strict" and formats
by mrider (Sexton) on Mar 24, 2005 at 22:00 UTC

    Darn. I knew it had to be something simple that I was missing. I just couldn't find anything with any searches - presumably because the terms "use strict" and "format" are too general. Anyway, here's hoping that at least some other obsessive-compulsive person will be able to find my question and your answer.

    Thanks Joost!!

    (Update)FWIW, being a noob to this site (first post ever) I didn't realize it is somewhat of a faux pas to create a new post saying "thanks". Personally - I think one "thank you" lets the person which replied know that their answer was used. More than once I've posted replies (elsewhere), and had absolutely no idea whether the original poster even read my reply, never mind whether it worked or no. One way I suppose I can make this rambling cruft a bit more worthwhile is to humbly request a pointer to where the correct answer is documented, so that I don't have to ask silly questions like this again.

    (Update - Update)Found the thread regarding "perldoc" not too long after posting my first update (where I read about "thanks"). Too bad I didn't know about perldoc a bit sooner - my GoogleFoo wouldn't have taken such a beating. Thanks nonetheless schodckwm.

      Not a silly question...
          perldoc -f format

      But... (addressing silliness of not knowing) make yourself familiar with perldoc for general answers to similar questions. You may want to start with
          perldoc -h | more or
          perldoc perldoc and work from there.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-11-28 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (192 votes), past polls