We are switching from one server to another for our PERL Scripts, and
so far everything is working, but I am having problems with on program
which works on the old server but not the new one.
The problem I have is creating a file in a directory on another
server. I use "\\\\gailbapps\\cybraryn\\TDmenu\\A-Cyb_Stats\\" as my
path to the serever, and to create it, I use open (TOT_TXT,
'>{servername and filename}').
But when I try to write print TOT_TXT "Hello\n";, it does not work.
Can anyone help? I print out the path and put it in Windows Explorer
and it goes right there, so I do not know why it cannot be accessed.
The code is below:
$relative_addy = "\\\\gailbapps\\cybraryn\\TDmenu\\A-Cyb_Stats\\";
$month_year = $date_month . "_" . $date_year . ".txt";
$tot_file = $relative_addy . $month_year;
open (TOT_TXT, '>$tot_file') || die "$tot_file open failed: $!";
print "File: $tot_file<p>";
print TOT_TXT "Hello\n";
close(TOT_TXT);
I am not sure if this is a PERL problem, but if I am not doing a correct pat, I would like to know.
Joseph A Ruffino
IT Technician
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.