Re: References/unitialized variable error message

2002-02-17 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Geoffrey F. Green" <[EMAIL PROTECTED]>: > #!/usr/bin/perl -w > > my %table = ( > "key1" => > {search=> "alpha", > shortname=> "beta", > }, > "key2" => > {

Re: text file database question

2002-02-17 Thread victor
How about Berkely DB? "Hughes, Andrew" wrote: > I have been given the task to create a contest for which appox. 90,000 > people might be signing up(collected info: name, company, email, phone, > address1, address2). Due to various reasons, I am not able to use a true > database like mySQL to st

RE: Crop string to x characters

2002-02-17 Thread Gary Hawkins
> > How do I truncate a string to a particular number of characters? > > > You can use the substr() function, or optimize your regex: > > #!/usr/bin/perl -w > use strict; > > my $string; > > # with substr > $string = "hello word"; > $string = substr($string,0,4); > print "substr: $string\n"; > >

Re: need help to output to screen and file simultaneously

2002-02-17 Thread jimf
Jeff 'Japhy' Pinyan wrote: > > On Feb 17, jimf said: > > >This little script is one of my first attempts with perl, it works ok > >but I would also like to capture the output to file. Help appreciated. > >Would also appreciate constructive criticism of the script > >itself.(oh,oh!) > > > >The sc

Re: Crop string to x characters

2002-02-17 Thread Briac Pilpré
On Sun, 17 Feb 2002 at 22:34 GMT, Gary Hawkins wrote: > --=_NextPart_000_02E4_01C1B7C0.2E6F3B50 > Content-Type: text/plain; > charset="US-ASCII" > Content-Transfer-Encoding: 7bit > > How do I truncate a string to a particular number of characters? > > This is expensive: > > $shortdesc

Crop string to x characters

2002-02-17 Thread Gary Hawkins
How do I truncate a string to a particular number of characters? This is expensive: $shortdescription =~ s/( ).*/$1/; Gary -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Perspective on $foo [slightly OT]

2002-02-17 Thread John
Hi all, In the recent past, I've noticed that several participants of this list have asked about the meaning / background / derivation of the commonly used variable: $foo. Now, those making this inquiry have had a more than reasonable basis for their confusion. Other than being just a variable,

Re: recommend oo tut

2002-02-17 Thread zentara
On Sat, 16 Feb 2002 20:31:29 -0800 (PST), [EMAIL PROTECTED] (Simon K. Chan) wrote: >Hi All, > >I'm not new to perl, however I would like to pick up some object-oriented perl. >Can anyone out there recommend a good BEGINNER'S tutorial out there? I've spent >some time searching on Google, couldn't

Re: How to copy and keep file permissions

2002-02-17 Thread zentara
On Sat, 16 Feb 2002 20:23:02 +, [EMAIL PROTECTED] (Craig Eberly) wrote: >Hey, any help would be appreciated. >I just wanted to make a simple backup script to backup any file i >specified quickly.. and eventually let it accept options and whatnot for >directories, but right now, I'm just tryin

RE: Regular Expressions - matching the first time

2002-02-17 Thread Jeff 'japhy' Pinyan
On Feb 15, Russ Foster said: >> As of Perl 5.6.2 (not released yet), /^(.*?):/ and >> /^([^:]*):/ will have the same efficiency (read: speed). If >> you're curious, currently /^.*?:/ and /^[^:]*:/ have the same >> speed -- it's the capturing that killed .*?, but I have fixed that. > >Just to

Re: need help to output to screen and file simultaneously

2002-02-17 Thread Jeff 'japhy' Pinyan
On Feb 17, jimf said: >This little script is one of my first attempts with perl, it works ok >but I would also like to capture the output to file. Help appreciated. >Would also appreciate constructive criticism of the script >itself.(oh,oh!) > >The script basically takes a named file, and searche

need help to output to screen and file simultaneously

2002-02-17 Thread jimf
This little script is one of my first attempts with perl, it works ok but I would also like to capture the output to file. Help appreciated. Would also appreciate constructive criticism of the script itself.(oh,oh!) The script basically takes a named file, and searches the file for a specified

Re: recommend oo tut

2002-02-17 Thread Randal L. Schwartz
> "Simon" == Simon K Chan <[EMAIL PROTECTED]> writes: Simon> I'm not new to perl, however I would like to pick up some Simon> object-oriented perl. Can anyone out there recommend a good Simon> BEGINNER'S tutorial out there? I've spent some time searching Simon> on Google, couldn't find much