Re: Padded 3 digit numeric series

2006-03-12 Thread Robin Sheat
On Sunday 12 March 2006 18:22, Shawn Corey wrote: > Believe it or not, write the number as a string. > for ( '000' .. '100' ){ >    print "$_\n"; > } Note that if you have a string such as "000", you can treat it like a number: my $a = '000'; $a++; print "$a\n"; This will print '001'. To have it

Re: Padded 3 digit numeric series

2006-03-12 Thread Shawn Corey
Robin Sheat wrote: On Sunday 12 March 2006 18:22, Shawn Corey wrote: Believe it or not, write the number as a string. for ( '000' .. '100' ){ print "$_\n"; } Note that if you have a string such as "000", you can treat it like a number: my $a = '000'; $a++; print "$a\n"; This will print '00

Re: Padded 3 digit numeric series

2006-03-12 Thread Harry Putnam
"Chas Owens" <[EMAIL PROTECTED]> writes: > sprintf is definitly the correct answer, but just to prove TIMTOWTDI > > #!/usr/bin/perl > > use strict; > > print zeropad(5,100), "\n"; > > sub zeropad { > my ($count, $n) = @_; > return substr '0' x $count . $n, -$count; > } I probably

Re: Padded 3 digit numeric series

2006-03-12 Thread Harry Putnam
Robin Sheat <[EMAIL PROTECTED]> writes: > Note that if you have a string such as "000", you can treat it like a > number: > my $a = '000'; > $a++; > print "$a\n"; Haaa, there it the obvious way I didn't see in Shawns post. thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional co

Re: Padded 3 digit numeric series

2006-03-12 Thread Harry Putnam
"John W. Krahn" <[EMAIL PROTECTED]> writes: >> Its just the numeric part I need a jump start on. > > $ perl -le' > for my $number ( 0 .. 4, 997 .. 1003 ) { > my $filename = sprintf q[%03d.ext], $number; > print $filename; > } > ' Ahh. Nice, thanks. I didn't recognize the `q[...]'

Re: Padded 3 digit numeric series

2006-03-12 Thread Harry Putnam
Shawn Corey <[EMAIL PROTECTED]> writes: [...] > > Believe it or not, write the number as a string. > > #!/usr/bin/perl > > use strict; > use warnings; > > for ( '000' .. '100' ){ > print "$_\n"; > } > > __END__ Thanks... This has the right output but its not very obvious how one would use thi

Re: Padded 3 digit numeric series

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: Ahh. Nice, thanks. I didn't recognize the `q[...]' usage but it appears to operate the same as "%03d,ext", $number; No, it would be the same as '%03d.ext' On the other hand, qq[%03d.ext] would be the same as "%03d.ext" See `perldoc perlop` and search for "Quote a

Re: Padded 3 digit numeric series

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: This has the right output but its not very obvious how one would use this to increment a counter and files are being renamed. As you would any other variable that contains a string. my $file = "$_.ext"; or my $file = $_ . '.ext'; or my $file = sprintf( '%s.ext', $

Win32 Module to change local Password on Remote Computers

2006-03-12 Thread Babale Fongo
Hi, I'm trying to programmatically change a local password on several Computers, but the Win32API::Net and Win32::NetAdmin modules seem not to be appropriate for that. Wondering whether there's any Win32 API module for that. I tried using the UserChangePassword function, and wasn't surprise it

Re: Padded 3 digit numeric series

2006-03-12 Thread Harry Putnam
Robin Sheat <[EMAIL PROTECTED]> writes: > Note that if you have a string such as "000", you can treat it like a > number: > my $a = '000'; > $a++; > print "$a\n"; > > This will print '001'. That looks like the tidiest way to do it in this case. Just start the count with my $a and were done.

Process a subroutine

2006-03-12 Thread Sky Blueshoes
is there a way to run a subroutine as a seperate process without using fork? SkyBlueshoes -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Process a subroutine

2006-03-12 Thread Tom Phoenix
On 3/12/06, Sky Blueshoes <[EMAIL PROTECTED]> wrote: > is there a way to run a subroutine as a seperate process without > using fork? Not really. On Unix, fork() is the chief system call to create new processes. But you can pretend you didn't use fork, if you use something like Acme::Spork to do

Perl Wallpapers

2006-03-12 Thread Monomachus
Do you know any sites with Perl wallpapers? Or do you have any Perl wallpapers? -- Thanks Monomachus Don't worry, Be Happy -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Can't compile/install module XML::LibXML either via CPAN or compile

2006-03-12 Thread Ed Young
I'm unable to install XML::LIbXML either via CPAN or by compiling the source directly. I'm running WXP Home, cygwin, and WebServe (ActivePerl). Perl version 5.8.7. When I try to compile/install it tells me it can't find -lxml2 and -llibxml2. I have installed both of these ( c libraries ) in m

What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
I'm already bald so don't have the luxury of pulling hair over this. I don't understand the error ouput or maybe I could get somewhere with this. Pouring over perldoc File::Copy isn't helping either... I think the error is before that but can't see what. The end result of this script is suppos

script won't create text file on server

2006-03-12 Thread Elliot Holden
for some reason or another, my script won't create the text file that it is supposed to create on the server. For example, I'm taking a survey and calculating votes for a favorite song. The script IS calculating the votes so the text file is being created somewhere, but the text file is not sho

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: I'm already bald so don't have the luxury of pulling hair over this. I don't understand the error ouput or maybe I could get somewhere with this. Pouring over perldoc File::Copy isn't helping either... I think the error is before that but can't see what. The end result of

Re: script won't create text file on server

2006-03-12 Thread Shawn Corey
Elliot Holden wrote: for some reason or another, my script won't create the text file that it is supposed to create on the server. For example, I'm taking a survey and calculating votes for a favorite song. The script IS calculating the votes so the text file is being created somewhere, but the

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
> I'm already bald so don't have the luxury of pulling hair over this. [...] > $new = $tmpdir."/".$new; > $oldf = $File::Find::name; > print "hpdb cp\'ing $oldf => $new\n"; > copy($oldf, $new) > or die "Failed to copy $oldf => $new: $!"; > } I figured out the sour

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
Shawn Corey <[EMAIL PROTECTED]> writes: > When File::Find goes looking for files, it chdir's to each directory > its looking in. When it's in ./dir1, there is no ./dir1/tmp to copy > files into, so you get an error. Change your calling sequence of > find() to: > > find( { wanted => \&wanted, no_

Re: What is wrong with this file copy script

2006-03-12 Thread Harry Putnam
Shawn Corey <[EMAIL PROTECTED]> writes: > When File::Find goes looking for files, it chdir's to each directory > its looking in. When it's in ./dir1, there is no ./dir1/tmp to copy > files into, so you get an error. Change your calling sequence of > find() to: > > find( { wanted => \&wanted, no_

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: That formula did'nt do it either but it did show a different error that throws some light on this. Notice the first file is the directory name hpdb cp'ing ./dir1 => tmp/001 Failed to copy ./dir1 => tmp/001: Is a directory at ./renum2.pl line 113 Thats why copy i

Re: What is wrong with this file copy script

2006-03-12 Thread Shawn Corey
Harry Putnam wrote: #!/usr/local/bin/perl -w @directories = ("./dir1", "./dir2"); for(@directories) { opendir(WRK_DIR,"$_"); opendir(WRK_DIR,$_) or die "cannot opendir $_: $!\n"; chdir $_; chdir $_ or die "cannot chdir $_: $!\n"; # This fails for the second directory since it chdir to

Re: What is wrong with this file copy script

2006-03-12 Thread JupiterHost.Net
Hello Harry, hpdb cp'ing ./dir1/2765 => ./tmp/001 Failed to copy ./dir1/2765 => ./tmp/001: No such file or directory at ./renum2.pl line 111 I didn't want to read the entire script (a triffle busy ;p) but perhaps File::Copy::Recursive (IE dircopy()) will help. Then if the file na

Re: script won't create text file on server

2006-03-12 Thread Tom Phoenix
On 3/12/06, Elliot Holden <[EMAIL PROTECTED]> wrote: > for some reason or another, my script won't create the text file that it > is supposed to create on the server. For example, I'm taking a survey > and calculating votes for a favorite song. The script IS calculating the > votes so the text fil

displaying hash vlues

2006-03-12 Thread Elliot Holden
this is my hash below: my %dept_and_names = ("Accounting", "John Montgomery", "Customer Service", "Carol Jefferson", "Customer Service", "Jill Paulo", "Research and Development", "Jeffrey Johnson", "Accountin

Re: displaying hash vlues

2006-03-12 Thread John W. Krahn
Elliot Holden wrote: > this is my hash below: > > > my %dept_and_names = ("Accounting", "John Montgomery", > "Customer Service", "Carol Jefferson", > "Customer Service", "Jill Paulo", > "Research and Development", "Jeffrey Johnson", > "Accou

Re: displaying hash vlues

2006-03-12 Thread Tom Phoenix
On 3/12/06, Elliot Holden <[EMAIL PROTECTED]> wrote: > my %dept_and_names = ("Accounting", "John Montgomery", > "Customer Service", "Carol Jefferson", > "Customer Service", "Jill Paulo", > "Research and Development", "Jeffrey Johnso

Out of memory! - from CPAN

2006-03-12 Thread Jerry K
I have perl 5.8.7 running on a well patched Solaris 10 update 1 Sparc system. I compiled perl on this system using the latest gcc for Solaris 10 from sunfreeware.com. I use a lot of modules, I am guessing 80-90, in support of webmin, spamassassin, and other open source utilities. As the numb

Re: Out of memory! - from CPAN

2006-03-12 Thread Owen Cook
On Sun, 12 Mar 2006, Jerry K wrote: > I have perl 5.8.7 running on a well patched Solaris 10 update 1 Sparc > system. I compiled perl on this system using the latest gcc for Solaris > 10 from sunfreeware.com. > > / 655 # perl -MCPAN -e shell > > cpan shell -- CPAN exploration and modules

Re: Out of memory! - from CPAN

2006-03-12 Thread Jerry K
Hello Owen, thank you for your reply. When I started over again, yes, I did remove .cpan . I have set .cpan to 20 Mb. My .cpan/build directory was at 21 Mb. I cleaned that directory out. I still get the "Out of memory!" error. Jerry K Owen Cook wrote: On Sun, 12 Mar 2006, Jerry K w

Re: beginners Digest 13 Mar 2006 05:54:58 -0000 Issue 2791

2006-03-12 Thread Martin
Hi, I am trying out to get a an attribute value from the given text. Kindly help me out in this regard. Input text: The Bill for this Act of the Scottish Parliament was passed by the Parliament on 15th December 2005 and received Royal Assent on 20th January 2006 Output needed: The Bill for t