Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: unix to perl questions

by deyaneria (Acolyte)
on Mar 12, 2015 at 00:18 UTC ( [id://1119712]=note: print w/replies, xml ) Need Help??


in reply to Re: unix to perl questions
in thread unix to perl questions

I tried using the use warnings: use strict; when i first got this version I had errors even with the simple "hello World" program putting them as you suggested. I found I have to put in the first line like this #! /usr/local/bin/perl –w I think it's due to the fact I'm using version v5.18.2.

Replies are listed 'Best First'.
Re^3: unix to perl questions
by Anonymous Monk on Mar 12, 2015 at 01:12 UTC

    The page Use strict and warnings explains how to get your program working under strict. It sounds like in your case the best way to start your scripts would be

    #!/usr/local/bin/perl use warnings; use strict;

    (The -w command line switch is not needed if you use warnings;.)

    If you get errors, please post the exact error messages here; see How do I post a question effectively?

      I did try it again to recreate the error I got. After my first script I had to download somthing for UBuntu. Perhaps it fixed the error or most likely I messed something up when trying to use: use warning; and use strict; before.

      I did do that before when writing a simple hello world script, and it gave me an error on a perfectly good running script. I haven't tried it since I had to add patch to Ubuntu for Perl. However I will give it a shot again. That is why I used the command line script instead.

Re^3: unix to perl questions
by 2teez (Vicar) on Mar 12, 2015 at 02:24 UTC

    ..I tried using the use warnings: use strict; when i first got this version I had errors even with the simple "hello World" program putting them as you suggested...

    How does the error read? Can you show it here?

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me
      I tried to recreate it for you but it worked fine. I had to do a patch on my UBuntu maybe that fixed it or I did something wrong. Probably the latter.
      I tried to recreate the error. I had to download a something UBuntu maybe it fixed the error but more likely I messed something up with my newbie fumbling. It worked perfectly this time thank you for pushing me to try it again.

Log In?
Username:
Password:

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

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

    No recent polls found