Re: Understanding Perl better.

2002-02-16 Thread John W. Krahn
Tor Hildrum wrote: > > On 17/2/02 06:01, "John W. Krahn" <[EMAIL PROTECTED]> wrote: > >> > >> open (WRITEFILE, ">$names[2]") || die ("Couldn't open $names[2] > >> for writing\n"); > > > > You should include the $! variable in your error messages. > > I don't really know what $! is. > I tried look

Re: Understanding Perl better.

2002-02-16 Thread John W. Krahn
Tor Hildrum wrote: > > I have 2 questions. > > Here is the code: > #!/usr/bin/perl > use warnings; > use strict; Very good start. > # Merging two files > > print ("Write the two files you wan't to merge and \n"); > print ("lastly the file to merge them too, seperated by a space.\n"); Parent

recommend oo tut

2002-02-16 Thread Simon K. Chan
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 find much for a oo newbie. Right now, I reading Randal's oo tutorial on CPAN. Thanks

Understanding Perl better.

2002-02-16 Thread Tor Hildrum
I have 2 questions. Here is the code: #!/usr/bin/perl use warnings; use strict; # Merging two files print ("Write the two files you wan't to merge and \n"); print ("lastly the file to merge them too, seperated by a space.\n"); chop (my $filenames = ); my @names = split(/ /,$filenames); # Get t

Re: References/unitialized variable error message

2002-02-16 Thread Geoffrey F. Green
On 2/16/02 7:15 PM, "Briac Pilpré" <[EMAIL PROTECTED]> wrote: > To iterate over a hash, you want to use the keys() function. I once knew that, but I haven't used perl enough so I forgot. I gues that's why they call this list "Beginners." Thanks a lot - geoff -- To unsubscribe, e-mail:

Re: References/unitialized variable error message

2002-02-16 Thread Michael Fowler
On Sat, Feb 16, 2002 at 07:07:28PM -0500, Geoffrey F. Green wrote: > my %table = ( > "key1" => > {search=> "alpha", > shortname=> "beta", > }, > "key2" => > {search => "gamma", >

Re: References/unitialized variable error message

2002-02-16 Thread Briac Pilpré
On Sun, 17 Feb 2002 at 00:07 GMT, Geoffrey F. Green wrote: > Hi. Newbie to perl here. I've got two problems (well, two perl-related > problems), relating to the same program. To iterate over a hash, you want to use the keys() function. foreach my $keys ( keys %table) { print $table{$ke

References/unitialized variable error message

2002-02-16 Thread Geoffrey F. Green
Hi. Newbie to perl here. I've got two problems (well, two perl-related problems), relating to the same program. 1. I'm putting together some test programs to try to get down the syntax for references, etc., but I'm coming across a weird situation I can't figure out. I'm setting up a hash of ha

DB_File and auto sorting DB's

2002-02-16 Thread zentara
Hi, I'm starting to look at perl db's, and I ran across something, but I'm not sure what it's about. I have questions. In the below code, if I comment out "use DB_File"; I get an unsorted printout, and only 2 files are created, dbmdatabase.dir and dbmdatabase.pag. Everything seems fine. If I l

How to copy and keep file permissions

2002-02-16 Thread Craig Eberly
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 trying to get it to keep the file permissions of the original file. I'm using File::C

Re: STDOUT & STDERR

2002-02-16 Thread John W. Krahn
Angus Laycock wrote: > > Hi, Hello, > I want to print messages from a script to either > STDOUT or STDERR depending on a value of a variable. > I want to control where I send the print statements > to. Can I do something like this or are there other > ways to control the target I send my messag

STDOUT & STDERR

2002-02-16 Thread Angus Laycock
Hi, I want to print messages from a script to either STDOUT or STDERR depending on a value of a variable. I want to control where I send the print statements to. Can I do something like this or are there other ways to control the target I send my message to. I'm hoping there are lots of other

Re: Running Perl Scripts

2002-02-16 Thread M4Ck B3nN4Ck
Em Sábado 16 Fevereiro 2002 14:53, Chris escreveu: > I'm using redhat linux 7.2 and have a question about running > perl scripts. How do you make it so you do not have to type > "perl script.pl" every time you want to run a scripts. I just > want to be able to type the name of my script. Thanks.

Re: Running Perl Scripts

2002-02-16 Thread Chris Garaffa
Ah shoot... On Saturday, February 16, 2002, at 12:04 PM, Chris Garaffa wrote: > > ../script.pl > Should have been ../script.pl one period (damn typos) My apologies Chris -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Running Perl Scripts

2002-02-16 Thread Chris Garaffa
At the beginning of the script (on the first line), put #!/usr/bin/perl or whatever the path to your perl binary is Make sure you chmod the .pl file with correct permissions, and then type ../script.pl On Saturday, February 16, 2002, at 11:53 AM, Chris wrote: > I'm using redhat linux 7.2 and hav

Running Perl Scripts

2002-02-16 Thread Chris
I'm using redhat linux 7.2 and have a question about running perl scripts. How do you make it so you do not have to type "perl script.pl" every time you want to run a scripts. I just want to be able to type the name of my script. Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: SPLIT

2002-02-16 Thread Andrea Holstein
In article <002501c1b66e$b8594340$cbfea8c0@agustinr> wrote "Agustin Rivera" <[EMAIL PROTECTED]>: > How would I keep the character (or characters) that I am splitting by? > > for example, > > @tags=split(/>/, $line); > > I would like to keep the ">". > print join("\n",split /(?=\>)/, "1>2>3>"

Re: arrays and refs...argh!

2002-02-16 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Ron Goral" <[EMAIL PROTECTED]>: > Can someone please tell me why the following code only returns the last element in >the referenced > array? If I put the foreach routine inside the while loop, I get a printout of each >element in > both the $sqlRes refer

Re: Difference between \[^x]*[^a]*

2002-02-16 Thread Andrea Holstein
In article <[EMAIL PROTECTED]> wrote "Eric Beaudoin" <[EMAIL PROTECTED]>: > At 22:56 2002.02.15, Jim Witte wrote: >> What is the difference between \[^x]*[^a]*cleaning up a >> webpage, trying to find paragraph tags followed by list-item tags (some of which >had a space >> inside the tag), wit

Re: urgent gettting '$var' as a String 'value of $var'

2002-02-16 Thread Andrea Holstein
In article <01c1b6e3$01433e20$62a3933e@w3w6d9> wrote "Mb" <[EMAIL PROTECTED]>: > Sure i m the only one doing perl in the week-end, the mailinglist is deserted. :-) > > I' m tryig to generate dynamic SQL statements. > I have a problem on getting a WHERE over 'varchar' type fields. I don'

Re: Passing an array from a 2-D array

2002-02-16 Thread Ian P . Thomas
On Thursday, February 14, 2002, at 08:12 PM, Michael Fowler wrote: > On Thu, Feb 14, 2002 at 04:14:39PM -0500, Ian P. Thomas wrote: >> >> # The array, unchecked_dfa_states, is going to be an array of arrays >> ( 2-D ). >> # dfa_state_creation is a subroutine that returns an array, and takes >>

Re: HTML Template and HTML Mason

2002-02-16 Thread Matt C.
I love HTML::Mason, although you may have a tough decision, as there are several good templating systems out there. Here's why I like Mason: 1) It's easy to setup, and has good error handling so if you goof up you can fix your code quickly , something I do alot of ;). Speaking of that, I find the

urgent gettting '$var' as a String 'value of $var'

2002-02-16 Thread mb
Hi all, Sure i m the only one doing perl in the week-end, the mailinglist is deserted. I' m tryig to generate dynamic SQL statements. I have a problem on getting a WHERE over 'varchar' type fields. for ($i =0; $i I want to get 'mars'. "select DE_Intitule, @select from F_Depot $stringW" -

Re: Writing to a file

2002-02-16 Thread Briac Pilpré
On Sat, 16 Feb 2002 at 01:19 GMT, Naika - Ev1 wrote: > I'm trying to write to a file from a 5 choice radio form and I keep > getting this error > Undefined subroutine &main::param called at pollresults_rg.pl line 5. > What does that mean? It means that the param() subroutine can't be found in th