ok Im lost as to why I can not open a file...
ok first the version im runnning
$ perl -v
This is perl, version 5.005_03 built for sun4-solaris
I dont have root or privleages so i cant change this :(
#!/usr/bin/perl -w
open(OUT,"> /export/home/foo/bar/test.csv") or die "Cannot open output
+ file;
print OUT "foo,bar,totally foobar\n"
This works just fine I tested by #'ing out all lines but those 2
When I add this line it doesnt work and I do not understand why?
open(READ,"/export/home/foo/bar/foo.log") or die "Cannot open foo.log\
+n";
while ($line = <READ>)
{
probably have my head up my ..... but I just cant figure it out. I get the following error
syntax error at test.pl line 4, near "open"
Execution of test.pl aborted due to compilation errors
ohh wise monks can you help?
Title edit by tye
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.