Hi,
this does not work:
mkdir "/some/dir/newsubdir" or die "$!";
while this does:
chdir "/some/dir";
mkdir "newsubdir/" or die "$!";
In the shell, I can obviously execute the former.
Is it true that in Perl, I can create a directory only within the current
working directory?
Thanks,
Jan
--
Jan Eden wrote on 26.07.2005:
>Hi,
>
>this does not work:
>
>mkdir "/some/dir/newsubdir" or die "$!";
>
>while this does:
>
>chdir "/some/dir"; mkdir "newsubdir/" or die "$!";
>
>In the shell, I can obviously execute the former.
>
>Is it true that in Perl, I can create a directory only within the
Jan Eden wrote:
> Hi,
Hello,
> this does not work:
>
> mkdir "/some/dir/newsubdir" or die "$!";
That works for me. What error message do you get?
Have you tried the mkpath() function from the File::Path module?
perldoc File::Path
John
--
use Perl;
program
fulfillment
--
To unsubscribe,
Hi John,
John W. Krahn wrote on 26.07.2005:
>Jan Eden wrote:
>> Hi,
>
>Hello,
>
>> this does not work:
>>
>> mkdir "/some/dir/newsubdir" or die "$!";
>
>That works for me. What error message do you get?
>
I get "File exists". /some/dir does exist, but newsubdir does not.
>Have you tried the mk
On Jul 26, 2005, at 11:31, Jan Eden wrote:
But I wonder why my initial example works for you. File::Path doc
says:
'The "mkpath" function provides a convenient way to create
directories, even if your "mkdir" kernel call won't create more
than one level of directory at a time. '
But my sy
Xavier Noria wrote on 26.07.2005:
>On Jul 26, 2005, at 11:31, Jan Eden wrote:
>> But I wonder why my initial example works for you. File::Path doc
>> says:
>>
>> 'The "mkpath" function provides a convenient way to create
>> directories, even if your "mkdir" kernel call won't create more
>> t
Thomas Bätzler wrote:
Tom Allison <[EMAIL PROTECTED]> wrote:
I find these a lot on email and I know it's some encoding
problem somewhere.
That's the quoted-printable encoding for MIME mails.
Of course you can handle it manually like japhy suggested,
but the proper way would be to use MIME::
Jan Eden wrote:
>
> John W. Krahn wrote on 26.07.2005:
>
>>Jan Eden wrote:
>>
>>>this does not work:
>>>
>>>mkdir "/some/dir/newsubdir" or die "$!";
>>That works for me. What error message do you get?
>>
> I get "File exists". /some/dir does exist, but newsubdir does not.
The message "File exis
> "Jan" == Jan Eden <[EMAIL PROTECTED]> writes:
Jan> chdir "/some/dir";
This might have failed...
Jan> mkdir "newsubdir/" or die "$!";
which would make this in the wrong directory. Are you checking that?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
http
Randal L. Schwartz wrote on 26.07.2005:
>The following message is a courtesy copy of an article
>that has been posted to perl.beginners as well.
>
>> "Jan" == Jan Eden <[EMAIL PROTECTED]> writes:
>
>Jan> chdir "/some/dir";
>
>This might have failed...
>
>Jan> mkdir "newsubdir/" or die "$!";
>
I got this error that reads something like: Can't call method "print"
on unblessed reference at {script name} , chunk 1.
In general terms, can anyone tell the what this is about so I can comb
through my script and fix this problem.
Thanks in advance,
Dave Adams
--
To unsubscribe, e-mail: [EMAIL
Hi Dave,
Dave Adams wrote on 26.07.2005:
>I got this error that reads something like: Can't call method
>"print" on unblessed reference at {script name} , chunk 1.
>
>In general terms, can anyone tell the what this is about so I can
>comb through my script and fix this problem.
>
>Thanks in adva
Dave Adams am Dienstag, 26. Juli 2005 17.29:
> I got this error that reads something like: Can't call method "print"
> on unblessed reference at {script name} , chunk 1.
>
> In general terms, can anyone tell the what this is about so I can comb
> through my script and fix this problem.
This means
On 7/25/05, FreeFall <[EMAIL PROTECTED]> wrote:
> try:
> perl -ne '$line=$_;END{print $line}' yourfile
>
> On Mon, 25 Jul 2005 19:09:50 +0530
> [EMAIL PROTECTED] wrote:
>
> >
> > hi ,
> > I am a perl newbie.
> > Can someone suggest a perl command line snippet that will print the last n
>
Does perl allow you to conditionally include a module?
For example:
#!/usr/bin/perl -w
use strict;
my $DEBUG = 0;
if (DEBUG) {
use diagnostics;
}
my $filename = "test$$.txt";
open (FH , ">$filename") || die "error: $!";
print (FH "hi");
close (FH);
Although this is a simple and silly example
Dave Adams wrote:
> Does perl allow you to conditionally include a module?
>
> For example:
>
> #!/usr/bin/perl -w
> use strict;
> my $DEBUG = 0;
> if (DEBUG) {
> use diagnostics;
> }
> my $filename = "test$$.txt";
> open (FH , ">$filename") || die "error: $!";
> print (FH "hi");
> close (FH)
Hi
I have csv file that has data something like this (Header in caps)
LOAN_NO,SCORE,BAL
77585,740,452125
77585,741,450256
85669,658,125869
85669,658,122586
Looking for ideas on the best way to skip/delete a line if the LOAN_NO
repeat even if other fields ion in the record are not the same (ne
Hello listers
I'm trying to use the following 'use lib' statement as described at
http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm
use lib "$ENV{HOME}/libperl"; # add ~/libperl
In a *test* program, I've written
$ENV{HOME} = 'home/tony/cgi-bin'; # My cgi-bin directory
Tony Frasketi wrote:
Hello listers
I'm trying to use the following 'use lib' statement as described at
http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm
use lib "$ENV{HOME}/libperl"; # add ~/libperl
In a *test* program, I've written
$ENV{HOME} = 'home/tony/cgi-bin'; # M
On Jul 26, Tony Frasketi said:
$ENV{HOME} = 'home/tony/cgi-bin'; # My cgi-bin directory
Are you sure there shouldn't be a / at the beginning of that?
use lib "$ENV{HOME}/pm"; # Add my personal perl module directory
The problem is that 'use lib' happens at compile-time, but y
Jim wrote:
>
> Hi
Hello,
> I have csv file that has data something like this (Header in caps)
>
> LOAN_NO,SCORE,BAL
> 77585,740,452125
> 77585,741,450256
> 85669,658,125869
> 85669,658,122586
>
> Looking for ideas on the best way to skip/delete a line if the LOAN_NO
> repeat even if other fi
On Jul 26, Jim said:
Looking for ideas on the best way to skip/delete a line if the LOAN_NO
repeat even if other fields ion in the record are not the same (need to
remove lines with dup key fields).
The code below seems to work, but there must be a better way.
Your code works fine, assuming th
this is driving me crazy. i worked on it for hours and cant figure it out.
i have an execuatable program, written in C, that prints its result as a string
to the terminal. and this program definitely works correctly on WinXP or
Win98. it prints the result to the screen. big deal, right?
when
23 matches
Mail list logo