Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Help in putting "$" as part of output

by perlfan (Curate)
on Mar 11, 2016 at 18:38 UTC ( #1157514=note: print w/replies, xml ) Need Help??


in reply to Help in putting "$" as part of output

Please change:

open(F,">$filename.inp");

to

open my $F, ">", "$filename.inp";

Then change all subsequent references from F to $F.

See open for more details. That won't fix your current issue, but it'll level up your code and beginner status.

Replies are listed 'Best First'.
Re^2: Help in putting "$" as part of output
by Anonymous Monk on Mar 11, 2016 at 19:15 UTC

    See open for more details. That won't fix your current issue, but it'll level up your code and beginner status.

    use autodie;

      I was trying to be semantically equivalent to the OP. Sure, I could have said open(F,">$filename.inp") or die;, but my intent was not to advocate for an error handling strategy one way or another. I've also never had a need to use autodie, so it's not a go-to of mine. I know people who swear by it and those who hate it. Me, I am indifferent. And lazy.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2018-09-19 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (166 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 16:53 UTC) Welcome new users!