Re: Changing some filenames

2008-12-27 Thread M.Lewis
John W. Krahn wrote: M.Lewis wrote: I have a need to manipulate some filenames. The files are all in a single directory. They are currently named in the form: 01012003-Rattler.tar.gz 01162003-Rattler.tar.gz 01312003-Rattler.tar.gz 02152003-Rattler.tar.gz These are backup files from a machi

Re: There is a error in a simple source

2008-12-27 Thread John W. Krahn
mobile.parmeni...@gmail.com wrote: Hi, Hello, I'm new to perl. The following code is wrong., and I can not spot it. Any suggestion? Thx. #!/usr/bin/perl -w #!/usr/bin/perl use warnings; use strict; &init_words (); init_words(); my %word; sub init_words{ while ( $filename=<*.sec

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 12:52 -0500, Chas. Owens wrote: > I too have worked at places that have these sorts of obnoxious > policies. Most often I have found that the policy has been created by > lazy sysadmins who don't want to take the time to install the modules > (or learn how, since often they d

There is a error in a simple source

2008-12-27 Thread mobile . parmenides
Hi, I'm new to perl. The following code is wrong., and I can not spot it. Any suggestion? Thx. #!/usr/bin/perl -w &init_words (); sub init_words{ while ( $filename=<*.secret> ){ open( WORDLIST, $filename ) || die "Can not open $filename: $!"; if ( -M WORDLIS

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 12:15, Mr. Shawn H. Corey wrote: > On Sat, 2008-12-27 at 11:51 -0500, Chas. Owens wrote: >> * only if you have Readonly::XS installed, otherwise it uses a tied >> variable that throws an error when STORE is called. > > The problem with Readonly et al. is that it is not a st

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 11:51 -0500, Chas. Owens wrote: > * only if you have Readonly::XS installed, otherwise it uses a tied > variable that throws an error when STORE is called. The problem with Readonly et al. is that it is not a standard module. I have worked in places that do not allow anythin

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 11:04, Mr. Shawn H. Corey wrote: snip > Perl does not have true constants. What `use constant` does is create a > sub that returns the value. That means you can use it as a sub in all > your code. snip Just out of curiosity, what is your definition of a "true constant"?

Re: Printing a constant array

2008-12-27 Thread Chas. Owens
On Sat, Dec 27, 2008 at 06:10, bacoms wrote: > Ho, I wanted to declare an HTML list as a constant array and then > print it but cannot work out the stntax. > > This is what I've coded; > > use constant NAVTABSLIST => ["\n", snip > pr...@navtabslist. snip You may be better served by the Readonly m

Re: Printing a constant array

2008-12-27 Thread Mr. Shawn H. Corey
On Sat, 2008-12-27 at 03:10 -0800, bacoms wrote: > Ho, I wanted to declare an HTML list as a constant array and then > print it but cannot work out the stntax. > > This is what I've coded; > > use constant NAVTABSLIST => ["\n", > " > \n", >

Printing a constant array

2008-12-27 Thread bacoms
Ho, I wanted to declare an HTML list as a constant array and then print it but cannot work out the stntax. This is what I've coded; use constant NAVTABSLIST => ["\n", " \n", "Home\n",

Re: Changing some filenames

2008-12-27 Thread John W. Krahn
M.Lewis wrote: I have a need to manipulate some filenames. The files are all in a single directory. They are currently named in the form: 01012003-Rattler.tar.gz 01162003-Rattler.tar.gz 01312003-Rattler.tar.gz 02152003-Rattler.tar.gz These are backup files from a machine. What I will ultimat

Re: Changing some filenames

2008-12-27 Thread John Refior
> So all I have is the filenames to put the files in date order. I believe > this would be the proper format to do this: > > 20030101-Rattler.tar.gz > 20030116-Rattler.tar.gz > 20030131-Rattler.tar.gz > 20030215-Rattler.tar.gz > > I wrote a short script to do this, and it will obviously work. My >

Changing some filenames

2008-12-27 Thread M.Lewis
I have a need to manipulate some filenames. The files are all in a single directory. They are currently named in the form: 01012003-Rattler.tar.gz 01162003-Rattler.tar.gz 01312003-Rattler.tar.gz 02152003-Rattler.tar.gz These are backup files from a machine. What I will ultimately be doing is