Re: multi element array question

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 10:13:04PM -0400, Bradford Ritchie wrote: > Could you please explain how your code suggestion below works? I've been > staring at it for a long time but it's not getting any clearer. Certainly. It's a hash slice. > > my %exuser; > > @exuser{ > > qw(root daemon

RE: Removing spaces

2001-07-18 Thread Brian
This should do it for you: $sring =~ s/^ +| +$//; Brian Johnson Partner/Systems Administrator/Programmer Source1Hosting.tv, LLC (www.source1hosting.tv) Source1Results.com, LLC (www.source1results.com) I may be insane, but remember - The only difference between an insane man and a genius is his j

Removing spaces

2001-07-18 Thread Rahul Garg
Hello everybody, A simple Q well i want to remove spaces if any in the beginning and end of a string. how to do this... Waiting for Reply... Thanx in advance .

URL encoding and decoding in submitting form

2001-07-18 Thread Lee, John
Hi everyone, I have just begun to code webpages using Perl and CGI.pm (by Lincoln Stein) not too long ago and I am encountering this problem. Basically, on one webpage, there is a link which passes data as part of the url like the one below: http://mysite/test.cgi?field1=abc&field2=def ghi As

Re: newbie: Sort Question

2001-07-18 Thread Groove Salad
Yep-- That did it. THANK YOU! gS On Wednesday, July 18, 2001, at 09:35 PM, Jeff 'japhy/Marillion' Pinyan wrote: > On Jul 18, Groove Salad said: > >> sub normalize >> { >> my $file = shift; >> my $s = sprintf("%02d",$1); >> $file =~ s/^env-//; >> $file =~ s/-(\d+)/$s/; >>

RE: Hyperlink to parse on SQL column entries.

2001-07-18 Thread Daniel Falkenberg
> > List, > > face="Verdana" size="3" color="#0155B1">$entries->{unique_id} > - color="#0155B1">$entries->{fname} > $entries->{lname}(input type="hidden" value=$) > > > The following Hyperlink in my HTML is incorperated in my perl script. I > want this hyperlink to parse to

Re: overriding exit();

2001-07-18 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 19, Rajeev Rumale said: >I feel if I override the main exit function in some way it would solve the >problem as this is called by default at the end. > >Kindly let me know how I if this is correct way? and if so how can I do this >with interfering with exit() in other modules. The exit()

Re: newbie: Sort Question

2001-07-18 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 18, Groove Salad said: >sub normalize >{ > my $file = shift; > my $s = sprintf("%02d",$1); > $file =~ s/^env-//; > $file =~ s/-(\d+)/$s/; > return $file; >} The $1 variable is related to the (\d+) in the regex. You can't use it as you have, since the regex hasn't happ

RE: Newbie system call question

2001-07-18 Thread Ken Cole
Hello, > Seems like you're stuck again. Okay, the problem here is the > ">/dev/null". Notice the ">" sign over there. It's the shell > redirection metacharacter which causes "the shell" to pipe > the output of > one script to a file. When you use "system" in list context, > like you're > doin

overriding exit();

2001-07-18 Thread Rajeev Rumale
Hello Everybody !, I would like to automate a part of my script. And think that overriding the exit() might be the solution. This what I need to do. For every request to an cgi script I need to perform two things 1. Some operations before executing the actual script. ( like loading preferences

RE: Newbie system call question

2001-07-18 Thread Abdulaziz Ghuloum
Hi again,, Seems like you're stuck again. Okay, the problem here is the ">/dev/null". Notice the ">" sign over there. It's the shell redirection metacharacter which causes "the shell" to pipe the output of one script to a file. When you use "system" in list context, like you're doing, you will

Re: What modules should I look to first?

2001-07-18 Thread Brett W. McCoy
On Wed, 18 Jul 2001, MRossland wrote: > I was wondering, what are the "Big 5 (or 10 or whatever)" Perl modules out > there, the ones that you wouldn't be caught dead without? The number of > modules avaible is large, and it would be nice to start in the right places. > > This is just a general qu

RE: Splitting string using split()

2001-07-18 Thread Brian
Wow, you have some good problems. Only solution I was able to come up with was something like this: $s = '[EMAIL PROTECTED], "Blow, Joe" <[EMAIL PROTECTED]>,Joe Blow <[EMAIL PROTECTED]>'; while($s) { # This is to match [EMAIL PROTECTED] if($s =~ /^([\w._]+\@[\w._]+),?\s*/) { $s = $';

Re: MCPAN

2001-07-18 Thread Ask Bjoern Hansen
[EMAIL PROTECTED] (Will Cottay) writes: > I changed line 1860 in 5.6.0/CPAN.pm to read: > > my $ftp = Net::FTP->new($host, Passive=>1); > > which works here, but I didn't spend much time looking to > see if anyone had done it properly. export FTP_PASSIVE=1 (or setenv FTP_PASSIVE 1 or whateve

Re: global variables in subroutines..?

2001-07-18 Thread Brett W. McCoy
On Wed, 18 Jul 2001, Stephanie Stiavetti wrote: > I'm writing a script to check for validity of form elements. here's what I > have so far: > > my ($job) = $cgi->param("job"); > > bla bla bla more script bla bla bla > > > sub fixFailed > { my (@failedFields); > my ($validForm)="1"; > >

Re: Newbie system call question

2001-07-18 Thread Abdulaziz Ghuloum
Hello, # use @args = ("/dir1/dir2/prgname","arg1","arg2","arg3","-p","/dev/null"); $rc = system @args; since "-p" is an argument just as much as "/dev/null" is an argument. Hope this helps,,, Aziz,,, In article <[EMAIL PROTECTED]>, "Ken Cole" <[EMAIL PROTECTED]> wrote: > if from the com

RE: Splitting string using split()

2001-07-18 Thread Mike Miller
Brian <[EMAIL PROTECTED]> wrote: > > I'm way rusty on my regexp's (been on vacation for a month without doing > any) but try this: > > $s =~ m/^([^,]+),\s*(\".+\>),(.+)/; > > $1 will be "[EMAIL PROTECTED]" > $2 will be '"Blow, Joe" <[EMAIL PROTECTED]>' > $3 will be "Joe Blow <[EMAIL PROTECTED]>

Re: multi element array question

2001-07-18 Thread Bradford Ritchie
Hi Michael, Could you please explain how your code suggestion below works? I've been staring at it for a long time but it's not getting any clearer. It looks like a neat construct but I don't get it...Thanks. -- Brad > > >

Re: newbie: Sort Question

2001-07-18 Thread Groove Salad
Hi: I made the change and the env-mmdd-0 file is indeed the first in the loop. Now they are not incrementing: The next file should be env-mmdd-1 env-mmdd-2 etc, but instead I'm getting this: checking: env-20010712-0 for message, GDPN9D00.SRY checking: env-20010712-0 for message, GDPN

Newbie system call question

2001-07-18 Thread Ken Cole
if from the command line a run /dir1/dir2/progname ar1 arg2 arg3 -p /dev/null it works. if I do: @args = ("/dir1/dir2/prgname","arg1","arg2","arg3","-p /dev/null"); $rc = system @args; The application stops with an error saying the -p /dev/null is an invalid argument. It is a standard argume

Re: newbie: Sort Question

2001-07-18 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 18, Groove Salad said: >Thanks for the quick response. I think what you've described is a bit >over my head. But, I'll try it and see what happens. > >The files will always be, env-mmdd-nn and will get rotated at months >end. However, your solution much more flexible. Since they'll

Re: newbie: Sort Question

2001-07-18 Thread Groove Salad
Thanks for the quick response. I think what you've described is a bit over my head. But, I'll try it and see what happens. The files will always be, env-mmdd-nn and will get rotated at months end. However, your solution much more flexible. Thanks again, gS On Wednesday, July 18, 2001,

Re: newbie: Sort Question

2001-07-18 Thread Jeff 'japhy/Marillion' Pinyan
On Jul 18, Groove Salad said: >checking: env-20010712-0 >checking: env-20010712-1 >checking: env-20010712-10 >checking: env-20010712-11 >checking: env-20010712-12 [snip] >checking: env-20010712-7 >checking: env-20010712-8 >checking: env-20010712-9 > >How can I get them in numerical order? I tried

Re: What modules should I look to first?

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 04:39:05PM -0700, MRossland wrote: > I was wondering, what are the "Big 5 (or 10 or whatever)" Perl modules out > there, the ones that you wouldn't be caught dead without? The number of > modules avaible is large, and it would be nice to start in the right places. > > This

OO Perl inheritance blues

2001-07-18 Thread Mark Maunder
Hi, At the moment, I'm doing: my $temp_obj = bless {}; in a childs SUPER class to create an object of SUPER's type that I can then use to call methods like: $temp_obj->method_two(); This ensures that when method_two does a $self = shift; and uses $self to call methods that exists in both the chil

Packages like ZIP,JAR etc ...

2001-07-18 Thread SunDog
Hi, Is it possible to package all the modules and main perl program inside a zip, jar or cab file and run this ? Archiving the runtime code provides portability and compactness but does PERL have something similar to the JAR utility in JAVA ? Thanking You in advance

RE: regex self taught, not fun...

2001-07-18 Thread Brian
Okay, the regexp: $line =~ s/^\s*(.+?)\s<(.+?)>,*/$1, $2/; Basically, $1 holds what is in the first set of (), and $2 holds what is matched in the second set of (). In otherwords, if you had the line: bob $1 would hold "bob", and $2 would hold "something in here". So, this regexp would rep

regex self taught, not fun...

2001-07-18 Thread Michael Carmody
Thanks for the regex, but that wasn't quite what I needed, it's functional but I still don't know how it works ! $line =~ s/^\s*(.+?)\s<(.+?)>,*/$1, $2/; OK so what does the $1 and $2 mean , what are they pointing to and how do I manipulate them... and what does the $& thingy do as well. Much

newbie: Sort Question

2001-07-18 Thread Groove Salad
Hi All: If I have files like the following: checking: env-20010712-0 checking: env-20010712-1 checking: env-20010712-10 checking: env-20010712-11 checking: env-20010712-12 checking: env-20010712-13 checking: env-20010712-14 checking: env-20010712-15 checking: env-20010712-16 checking: env-20010

RE: What modules should I look to first?

2001-07-18 Thread Brian
I would like to place my vote for these 3: CGI.pm DBI Date::Calc I think I use these 3 more than any others. Brian Johnson Partner/Systems Administrator/Programmer Source1Hosting.tv, LLC (www.source1hosting.tv) Source1Results.com, LLC (www.source1results.com) I may be insane, but remember - The

What modules should I look to first?

2001-07-18 Thread MRossland
Hi all, I was wondering, what are the "Big 5 (or 10 or whatever)" Perl modules out there, the ones that you wouldn't be caught dead without? The number of modules avaible is large, and it would be nice to start in the right places. This is just a general question, with no specific task in mind.

global variables in subroutines..?

2001-07-18 Thread Stephanie Stiavetti
I'm writing a script to check for validity of form elements. here's what I have so far: my ($job) = $cgi->param("job"); bla bla bla more script bla bla bla sub fixFailed { my (@failedFields); my ($validForm)="1"; #validate job selection if (!$job) {

Re: Assigning a string value to a scalar

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Customer Service" whispered: | The string sections I want are: | | &firstname=Nathan&lastname=Garlington& # for the $who and | | &submitButtoncattleman=Get+Quote%21 # for the $quote_type scalar. Based on these lines, I'm assuming this is coming from a

Assigning a string value to a scalar

2001-07-18 Thread Customer Service
I am trying to follow some good advice that Randal and Brian gave me earlier. I have a rather basic question, however. I want my script to print: “At (current time) on (date), $who submitted a request for a $quote_type quote.” Thanks to Brian, I have the time aspects all worked out.

RE: Truth and SQL

2001-07-18 Thread Steve Howard
Just a note on this. This does not work with all dbd's the version of DBD::ODBC I work with is one where it will not work. No matter how many rows are actually returned, $rows will always be -1 on this dbd. This is hinted at in perldoc DBI by the use of "if available" in the descriptions of this t

Re: Updating class variables - object oriented Perl

2001-07-18 Thread iain truskett
* Michael Fowler ([EMAIL PROTECTED]) [18 Jul 2001 18:24]: [...] > _Object Oriented Perl_ gets pretty advanced, but it does have chapters > on basic OO in Perl, and basic OO in general. It would probably be more accurate to say that _Object Oriented Perl_ takes one from knowing not necessarily an

Re: Really really new

2001-07-18 Thread Abdulaziz Ghuloum
Hello, The simplest way to do this is to first find the max length of the numbers: my @ar1 = qw/116 44 45 49 71/; my @ar2 = qw/1 1 3 5 1/; my $max = length ((sort {$b <=> $a} (@ar1,@ar2))[0]); # assuming all

Re: Perl IDE Reviews

2001-07-18 Thread Bill Lawry
Komodo 1.1 (downloaded last week) seems to have cleared up the mathmatical division problem. - Original Message - From: "Stephen Neu" <[EMAIL PROTECTED]> To: "Perl Beginners (E-mail)" <[EMAIL PROTECTED]> Sent: Friday, June 22, 2001 11:56 AM Subject: RE: Perl IDE Reviews > Don't know if

Re: Think there is something DBI

2001-07-18 Thread Abdulaziz Ghuloum
Hello, How about doing this: my @cols = qw(firstname lastname title phone email age location address address2 city state zip zip2 inst school_type grades_taught subjectarea_1 subjectarea_2 subjectarea_3 subjectarea_4 subjectarea_5 subjectarea_6 how_heard Occupation); my $dbh = DBI->connect(.

un small question

2001-07-18 Thread Sergio Gonzalez
hi fellow perl beginners, any idea how to move the 100 daily messages from this list to another folder before it gets to my unix based email client (pine). i read somewhere that it is better to deal with the mail transfer agent, before it gets to pine. (or something like that), thanks in advance

Re: string vs 'string' parameters

2001-07-18 Thread Paul
--- Ruth Albocher <[EMAIL PROTECTED]> wrote: > hi > can you please tell me what is the difference between the two > parameters > in the call: > > create_unit(SDunit, 'SDunit_name'); (it is code i need to > maintain... > ) Well, SDunit there is a bit odd. looks like a bareword -- does the scri

RE: unix perl to win NT perl

2001-07-18 Thread Billy Shaw
There is a decent start for a guest book in Learning Perl (Chapter 19). Read through it, add any security measures (as noted previously in this thread), and you will have a generic guestbook. Once you have done that, you have a script which can be edited and have functionality added. It is ver

Re: MCPAN

2001-07-18 Thread Will Cottay
I changed line 1860 in 5.6.0/CPAN.pm to read: my $ftp = Net::FTP->new($host, Passive=>1); which works here, but I didn't spend much time looking to see if anyone had done it properly. -will Terry Poperszky wrote: > > Question? How do I set MCPAN to use passive FTP connection? > > Terry --

Re: looking at rows in text files

2001-07-18 Thread Jos I. Boumans
I think you need to start reading on a few books my friend. here are a few places to start: read the regexp tutorial i wrote at http://japh.nu read "perldoc perlre" for more details look into getting "learning perl" by randal schwartz, it will teach you many of the basics you'll need for Perl n

Re: looking at rows in text files

2001-07-18 Thread Tyler Longren
Why does this work: open(APACHE_CONF, "/usr/local/apache/conf/httpd.conf") or die "Could not open Apache config file:\n$!\n"; my @servernames; while() { push (@servernames, $1) if/ServerName\swww.(.*)/; } close(APACHE_CONF);

Re: Think there is something DBI

2001-07-18 Thread syarbrough
I recently had a similar problem, but I took the lazy man's way out and substituted user-typed apostrophes with back quotes, using the following regexp: $message =~ s/'/`/g; Simple, but few people notice the difference between the two characters. Steven Yarbrough -- To unsubscribe, e-mail: [

PIX LOGS

2001-07-18 Thread Djilali ELKHIA
Hy, I'm interesting by a perl script for analysing a PIX firewall loggings if you have any informations please write me regards djilali ELKHIA

Oops! (was Re: if then and perl)

2001-07-18 Thread Sascha Kersken
Oops! I just discovered a little mistake made by quick copy'n'paste. The line elsif ($url =~ /^http:\/\//i) should read elsif ($url =~ /^ftp:\/\//i) of course. Sascha -- "We Apologize For The Inconvenience" (God's Last Message To His Creation by Douglas Adams)

string vs 'string' parameters

2001-07-18 Thread Ruth Albocher
hi can you please tell me what is the difference between the two parameters in the call: create_unit(SDunit, 'SDunit_name'); (it is code i need to maintain... ) (if it helps, then in the create_unit function, i get my $self = shift; my $type = shift; my $name = shift; my $unit;

MCPAN

2001-07-18 Thread Terry Poperszky
Question? How do I set MCPAN to use passive FTP connection? Terry

Re: Really really new

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Liger-dc <[EMAIL PROTECTED]> whispered: | I have a formatting question: | I have 2 arrays with integers that I want to print, with one array above the > other so that the | matching entries end up in the same column. Currently they look like.. | | 116 44 45

Thank you very much Brian and Randal

2001-07-18 Thread Customer Service

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sascha Kersken" <[EMAIL PROTECTED]> w hispered: | if ($url =~ /^http:\/\//i) Try and save yourself from going blind trying to decipher all those slashes and backslashes. If you have a literal slash in your code, change your delimiters: if ($url =~ m

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sparkle Williams" <[EMAIL PROTECTED]> whispered: | I'm trying to write a perl script that can distinguish between http and ftp | files. I got it to work on my UNIX system using case, but I can't seem to | get it to function correctly when I switch to usin

Re: looking at rows in text files

2001-07-18 Thread Jos I. Boumans
using 'my' within the while loop will make it lose it's value once the loop exits and it will be reset every time you read in a new line declare 'my @list' above the loop, and you'll not have that problem. for readabillity, use: if(/(\S+/){ push @list, $1 } altho that's a bit superfluous i think,

Re: Updating class variables - object oriented Perl

2001-07-18 Thread Paul Johnson
On Wed, Jul 18, 2001 at 03:59:14PM -, [EMAIL PROTECTED] wrote: > > #how to set an accessmethod > sub accessmethod{ > > my $self = shift; > > if (@_) { $self->[ACCESS_METHOD] = shift } > return $self->[ACCESS_METHOD]; > > }#end accessmethod > > > #here the problem occurs when trying to up

Re: Database on file

2001-07-18 Thread Jared Chenkin
In message <[EMAIL PROTECTED]>, Michael Fowler writes: >On Tue, Jul 17, 2001 at 06:43:14PM -0400, Jared Chenkin wrote: >> I'm kinda rusty on my perl..had to work in java for a while =( >> How do you take a multidimensional hash such as $hash{$key1}{$key2}{$key3} and >write it >> to a database fil

Re: looking at rows in text files

2001-07-18 Thread Tyler Longren
Here's what I have now: while() { push (my @list, $1) if /(\S+)/; } foreach my $h(my @list) { print "$h"; } I need to be able to access each individual host in the "FP" file pointer. This doesn't print anything to the screen.

RE: I'm parsing! But...

2001-07-18 Thread Brian
The foreach at the end is your alphabetical problem. But, there is another problem here. If you don't use foreach $key (sort keys(%formdata)) { the keys will be in a random order. You'll need to tie the %formdata has using the Tie::IxHash module. Example: #!c:/perl/bin/perl -w use strict; use

Re: Date question

2001-07-18 Thread Jerry Preston
Anna, There might be some help at http://theoryx5.uwinnipeg.ca/CPAN/data/Date-Calc/Calc.html Jerry [EMAIL PROTECTED] wrote: > > I know this might be easy but since I'm still learning > > Is there a easy way to have perl generate information to find out what the 3rd >friday is for each m

Re: Date question

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 12:32:21PM -0400, [EMAIL PROTECTED] wrote: > Is there a easy way to have perl generate information to find out what the > 3rd friday is for each month? I have been looking at some cpan modules > and none of them seem to do what I need. Date::Calc has a subroutine, Nth_Wee

RE: Date question

2001-07-18 Thread Brian
Best I can think is maybe using the Date::Manip module in a foreach or while loop to test each day and see if it is the 3rd week, and if indeed the day is a Friday. This would be kind of slow since you would have a lot of days to go through, but it would work. http://search.cpan.org/search?dist=

Re: looking at rows in text files

2001-07-18 Thread Jos I. Boumans
it's essentially the same thing, only instead of handing the match to the print operator, we store it in @list like so: open(FP, "$tempfile"); # Open $tempfile for reading while() { push @list, /(\S+)/ } $list[0] will hold the first match, $list[1] the 2nd and so forth hope this helps, Jos >

RE: I don't know what to title this question...

2001-07-18 Thread Brian
Here is the answer I gave about a day ago, but like a foolish man I posted it to the wrong list (beginners instead of beginners-cgi). Foolish Outlook mistake on my part. Sorry about that. But anyway, here ya go: I was involved in the writing of www.e-mol.com and we ran into this same problem, o

Re: Updating class variables - object oriented Perl

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 03:59:14PM -, [EMAIL PROTECTED] wrote: > I am doing some Object Oriented programming in Perl. > I have a problem getting the instance variables in some of my > classes updated. This is probably your problem right here. Instance variables are, by definition, not clas

Re: Really really new

2001-07-18 Thread Jason Purdy
How about this? (using printf) #!\Perl\bin\perl #I have a formatting question: #I have 2 arrays with integers that I want to print, with one array above the other so that the #matching entries end up in the same column. Currently they look like.. # @ar1 = qw(116 44 45 49 71); @ar2 = qw(1 1 3 5 1)

Reading in a data file

2001-07-18 Thread Mark Flynn
I need to read some data from an input file. I have a regex that picks out just numbers from the file, but I can't seem to be able get the ones I want. Here is the code I wrote: open (KA, "K.a") || die #reads file "K.a" "can't open K.a: $!"; LINE: while () { #r

Re: Think there is something DBI

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 04:27:28PM +0100, David Wood wrote: > Another point to mention is that DBI->quote looks not only at the value > being inserted, but also to the data_type of the table/field it's going > into, and replaces undef values with an unquoted NULL value, if > appropriate. This is

Really really new

2001-07-18 Thread Liger-dc
I have a formatting question: I have 2 arrays with integers that I want to print, with one array above the other so that the matching entries end up in the same column. Currently they look like.. 116 44 45 49 71 1 1 3 5 1 and I want them to look like 116 44 45 49 71 1 1 3 5 1 The probl

I'm parsing! But...

2001-07-18 Thread Customer Service
Hey all! Thanks for everybody’s help so far! Finally got the parsing script to work! Very excited about that. As a new perl programmer, my confidence is rising. Just used a cut & paste script, but had to reconfigure. At least I know what each line of code does (or think I do anyway). Heard that

Re: Oops! (was Re: if then and perl)

2001-07-18 Thread Michael Fowler
On Wed, Jul 18, 2001 at 03:11:22PM +0200, Sascha Kersken wrote: > Oops! > I just discovered a little mistake made by quick copy'n'paste. > The line >elsif ($url =~ /^http:\/\//i) > should read > elsif ($url =~ /^ftp:\/\//i) > of course. Actually, it should probably read something like:

Re: Think there is something DBI

2001-07-18 Thread David Wood
That really wouldn't work : ) Here we go:- # I'm assuming a DBI connection open with a handler called $dbh! while () { chomp; # Make each line a hash my %hash; @hash{qw(firstname lastname title phone email age location address address2 city state zip zip2 inst school_type grades_taught

Re: exit to the start of the outermost while loop

2001-07-18 Thread Brett W. McCoy
On Wed, 18 Jul 2001, Craig S Monroe wrote: > I basically a have a series of nested while loops that prompts the user > down a particular decision tree to a result. > What I was wondering, is there a way to exit an inner loop directly to the > initial while loop to start the program from the begin

exit to the start of the outermost while loop

2001-07-18 Thread Craig S Monroe
I basically a have a series of nested while loops that prompts the user down a particular decision tree to a result. What I was wondering, is there a way to exit an inner loop directly to the initial while loop to start the program from the beginning? It looks as though labels are only effective i

Re: Dynamic Data structures

2001-07-18 Thread Luke Bakken
use Data::Dumper; my $bears = {}; # declare here so it'll be available after while() my $n = 0; # for examples sake we're using DATA internal filehandle while() { chomp; my ($name, $type, $color, $food) = split /\|/; $bears->{"rec$n"} = {}; %{ $bears->{"rec$n"}

Date question

2001-07-18 Thread anna . roberts
I know this might be easy but since I'm still learning Is there a easy way to have perl generate information to find out what the 3rd friday is for each month? I have been looking at some cpan modules and none of them seem to do what I need. I did find something that might do it but it

Re: Think there is something DBI

2001-07-18 Thread borakovej
Hey David i tryed to pass the entire SQL statement through the dbh->quote like this and printed to see what i got and it is not quoting the input any ideas here is the code while() { chomp; my ($id,$firstname,$lastname,$title,$phone,$email,$age,$location,$address,$addr ess2,$city,$state,$zip,

Re: Dynamic Data structures

2001-07-18 Thread Chas Owens
On 18 Jul 2001 12:06:50 -0400, David Gilden wrote: > > Take this Data structure (which is an anonymous hash) > > # > # $bears = { > # > # > # rec0 => { > # name => 'sweaterie', > # type => 'sweater', > # color => 'golden brown', > # fo

Re: Updating class variables - object oriented Perl

2001-07-18 Thread Brett W. McCoy
On 18 Jul 2001 [EMAIL PROTECTED] wrote: > I am doing some Object Oriented programming in Perl. > > #my class constructor > sub new { > > my $invocant = shift; > my $class = ref($invocant) || $invocant; > my $self = []; > $self ->[ACCESS_METHOD] = undef; > $self ->[TOTAL_ACCESS_TIME] = undef; > $s

Dynamic Data structures

2001-07-18 Thread David Gilden
Take this Data structure (which is an anonymous hash) # # $bears = { # # # rec0 => { # name => 'sweaterie', # type => 'sweater', # color => 'golden brown', # food => 'mixed berries', # }, # ect # }; I am

Re: looking at rows in text files

2001-07-18 Thread Will Cottay
If your file really looks like that and you're really only trying to print the first column just: cut -d' ' -f1 < your.file from the command prompt. or if you want the dns server name instead: tr -s '[:blank:]' '\t' < cu.txt | cut -f2 -will Tyler Longren wrote: > > Hello everyone, > > I h

Updating class variables - object oriented Perl

2001-07-18 Thread sara
I am doing some Object Oriented programming in Perl. I have a problem getting the instance variables in some of my classes updated. If I update one variable in a class that contains several instance variables, then the other variable does not keep its original value, it gets the same value

RE: Tk system modal window

2001-07-18 Thread Elliott, Don (Police)
Pierre and other who have given me help: Since writing this message I have stumbled across the Win32::SetupSup module. Using this I am able to do the modal window plus kill window, min and max window, hide window in system tray, print all windows and other stuff that is not all that useful. I did

I don't know what to title this question...

2001-07-18 Thread daedalus
Hmm... I tried posting this at [EMAIL PROTECTED] but haven't gotten much back so I'll try here... Hi all, I hope this isn't a goofy question ;-) I have a simple CGI front end for processing Snort logs with Calamaris. It is currently set up like this: sub do_report {local ($command) = @_;

RE: Ok brain fart here...

2001-07-18 Thread Doug Johnson
Can we see a little more of the code? :o) Doug -Original Message- From: Richie Crews [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 11:43 AM To: Richie Crews; [EMAIL PROTECTED] Subject:RE: Ok brain fart here... Ok my problem is something not shown in the cod

RE: Ok brain fart here...

2001-07-18 Thread Richie Crews
Ok my problem is something not shown in the code... I was using a my $exch = "ICWPEX01" for each if statement and the my's seemed to be canceling it out... Richie Crews Unix Systems Administrator (706) 773 - 3436 CELL (706) 634 - 3681 DESK (706) 634 - 3831 FAX

RE: Ok brain fart here...

2001-07-18 Thread Daryl J. Hoyt
What are the errors? It works fine here. -Original Message- From: Richie Crews [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 10:27 AM To: [EMAIL PROTECTED] Subject: Ok brain fart here... Ok I am beating my head why this is not working... $fname = ; chomp $fname; $fletter

Re: Ok brain fart here...

2001-07-18 Thread GoodleafJ
--Warning-- Newbie responding In what way is it not working? I may be making the same mistake as you. It looks good to me, excepting that there's no prompt to tell someone to type in a string. So if it ran as-is, it would appear to be hanging there, when it's just waiting for input. -John

Re: Ok brain fart here...

2001-07-18 Thread Chas Owens
On 18 Jul 2001 11:26:45 -0400, Richie Crews wrote: > Ok I am beating my head why this is not working... > > $fname = ; > chomp $fname; > $fletter = substr($fname,0,1); > # now we have the first letter of the first name > if ( $fletter =~ /[a-f]/i) { > print "First letter is a-f\n"; >

RE: Ok brain fart here...

2001-07-18 Thread Doug Johnson
I did a cut and paste and it seems to work fine here.. What errors do you get or what result? Doug -Original Message- From: Richie Crews [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 18, 2001 11:27 AM To: [EMAIL PROTECTED] Subject:Ok brain fart here... Ok I am bea

Ok brain fart here...

2001-07-18 Thread Richie Crews
Ok I am beating my head why this is not working... $fname = ; chomp $fname; $fletter = substr($fname,0,1); # now we have the first letter of the first name if ( $fletter =~ /[a-f]/i) { print "First letter is a-f\n"; } You get the picture I would have other if's based on the first

Re: if then and perl

2001-07-18 Thread Will Cottay
Or, at the risk of beating a dead horse: #!/usr/bin/perl -w use strict; my $url = shift || ''; $url =~ /^(.*?):/; my $protocol = lc($1); my %handlers = ( 'http' => \&http_handler, 'ftp' => \&ftp_handler, 'https' => \&http_handler, 'ftps'

Re: META REFRESHES

2001-07-18 Thread SAWMaster
Thank you very much Abdulaziz, it works perfectly. I did not even know such a header existed, at first I was confused about what you were trying to say, but I looked around on the net and found what you meant. My page works flawlessly now, however I'm still puzzled why my meta refresh did not wo

Re: Think there is something DBI

2001-07-18 Thread David Wood
Incidentially, (and please don't take this as being picky, merely an observation) I have found that the qq method does not work 100% of the time, also! I've had to change code that was produced by an external contractor that was using this method and failing on unquoted apostrophes. Changed to D

RE: unix perl to win NT perl

2001-07-18 Thread Morbus Iff
>I'm not competant enough to write a complete guestbook script, only to edit >scripts I find. Any ideas where I can get a new guestbook script? You could try the following (in that order): http://perlarchive.com/ http://www.cgi-resources.com/ http://www.hotscripts.com/ -- Morbus Iff

RE: unix perl to win NT perl

2001-07-18 Thread Brett W. McCoy
On Wed, 18 Jul 2001, Sally wrote: > Apart from the dates on the top of the script, how can you tell it's old, > and why is it bad stuff? Because it was written by Matt Wright, and his scripts have been notorious for being porrly written, hard to maintain, and full of security holes. -- Brett

Still can't get this !@#$%^&* to work

2001-07-18 Thread Tom Yarrish
Hey all, Okay, I'm still trying to get this log file script to work. The end result should just be, if it's the 18th, the log file should be 09FIMSOM090Aevent-20010717.log. However, I keep getting it to produce the same day, instead of the previous. This script is set to run on an NT server

RE: unix perl to win NT perl

2001-07-18 Thread Sally
I'm not competant enough to write a complete guestbook script, only to edit scripts I find. Any ideas where I can get a new guestbook script? -Original Message- From: Morbus Iff [mailto:[EMAIL PROTECTED]] Sent: 18 July 2001 15:22 To: [EMAIL PROTECTED] Subject: RE: unix perl to win NT perl

RE: unix perl to win NT perl

2001-07-18 Thread Morbus Iff
>Apart from the dates on the top of the script, how can you tell it's old, >and why is it bad stuff? Much like cultures, programming evolves over time. It's old and bad because: 1. it's not written with security in mind. when the internet comes in play, security should be the number one

RE: Think there is something DBI

2001-07-18 Thread PURMONEN, Joni
David's method is probably better, but I still use just a long row of ? marks even in this situations. 20 odd question marks is not too bad ;) Somehow I've had more problems with the $dbh->quote($str) which very well may be because of my own errors. J -Original Message- From: borakovej

  1   2   >