Re: require command?

2001-06-12 Thread Timothy Kimball
Max Attems wrote: : now conf.cgi is ok but still, i get this error message, which i couldn't : fix: : Use of uninitialized value in string ne at send.cgi line 20. : line 20 is looking for a string defined in conf.cgi, why does it not use it. : line 20: if( $pass ne $passwort ) { : (the variable w

Re: Pushing more than 1 item onto a list

2001-06-12 Thread Timothy Kimball
Charles Lu wrote: : Functions like pop(), push() allow you to add or remove one element to or : from a list. Is there a function that allows you to add or remove "X" : number of elements where "X" > 1? push() can push more than one element: push(@array, $x, $y); But splice() can handle the

Re: require command?

2001-06-12 Thread Timothy Kimball
Max Attems wrote:: second attempt, now with correct email. : I saw an article about the list in perl.com : today an persisting error message occured. perhaps you would now a simple : answer. : : this is the code: : #!/usr/bin/perl -Tw : ... : require 'conf.cgi'; : : the conf.cgi is not mispell

Re: SWAPING COLUMNS

2001-06-08 Thread Timothy Kimball
Pedro A Reche Gallardo wrote: : Hi all, I have a file with 20 columns of positive and negative decimal : numbers (eg: 9.782 -8.983) separated by a black space, and everycolumn : is marked on top with an single alphabet letter. : This is an example. : : A D C B : 9.782 -8.983 -3.

Re: #!/usr/bin/perl

2001-06-07 Thread Timothy Kimball
Eric Wright wrote: : I installed Perl, when I search for perl I get /usr/bin/perl, but when I : include #!/usr/bin/perl in my source I still cant exicute it without; was that "which perl" or "whereis perl"? -- tdk

Re: AW: Sending XML-formatted messages over a https-Connection from a Perl programm

2001-06-06 Thread Timothy Kimball
Ela Jarecka wrote: : : All I know right now is that the client is a server, a physical maschine, on : which a process is running awaiting my : ( appropriately formatted ) messages. The process is a web server, yes? : Once it gets such a message it : generates requested data and sends it back

Re: one last attempt?

2001-06-06 Thread Timothy Kimball
Luinrandir Hernson wrote: : well i cant beleive it : know what the first problem was : spaces after and before the double dashes. : i was using : : and the correct command is : : this caused three days of hairpulling madness... : I'm laughing on the outside... but inside ERRR! Don't fe

Re: Sending XML-formatted messages over a https-Connection from a Perl programm

2001-06-06 Thread Timothy Kimball
Ela Jarecka wrote: : Could anybody help me in that subject? I am supposed to send an : XML-formatted message requesting data from a third-party system.. : Where should I start? Where do I find a Perl module supporting http streams? Also, LWP (also known as libwww-perl) can do this is you install

Re: Sending XML-formatted messages over a https-Connection from a Perl programm

2001-06-06 Thread Timothy Kimball
Ela Jarecka wrote: : Could anybody help me in that subject? I am supposed to send an : XML-formatted message requesting data from a third-party system.. : Where should I start? Where do I find a Perl module supporting http streams? Net::SSLeay will do this. It requires openssl to be installed.

Re: Link check problem.

2001-06-06 Thread Timothy Kimball
Bruno Veldeman wrote: : I am doing a sub for checking if a URL is active or not. : ... : If I try it on http://www.grn.es it works ($response->code = 200) : But with http://encarta.msn.es it returns 0. ($response->code = 500) Response code 500 means an internal error on the server. Your code is

Re: How to pass form data between two CGI's ?

2001-06-05 Thread Timothy Kimball
Tom O'Brien wrote: : Can someone please give me an example of how to pass form data between : two CGI programs? Here's what I'm attempting to do. : I'm a novice perl programmer at best so I'm just trying to modify two : programs to do what I need. Basically, I'm trying to use a "affiliate" : pr

Re: Fwd: 'use' question

2001-06-05 Thread Timothy Kimball
M.W. Koskamp wrote: : You are missing a semi-colon at the end of line 1 : after the #!/usr/local/bin/perl You don't need one there, because that line is not a perl command. It's a message to the shell that the script is to be interpreted by /usr/local/bin/perl. The problem is that he write

Re: Fwd: 'use' question

2001-06-05 Thread Timothy Kimball
Bob Mangold wrote: : !#/usr/local/bin/perl Should be '#!', not '!#'. -- tdk

Re: Thank You - Re: Probably a "no-brainer" - the last twomessages.

2001-06-05 Thread Timothy Kimball
Gary Luther wrote: : I am off applying salve to my wounds. It was careless of me to over look that . : : Thanks to the list. Sorry, to take eveyones time for so trivial of an item. You might be surprised be surprised at how many of these kinds of errors I make on a regular basis (for me, two t

Re: problem saving binary data

2001-06-05 Thread Timothy Kimball
Jeff Davis wrote: : I'm using LWP to fetch an image and attempting to save it locally. : The file is successfully created, however all it contains is: : : HTTP::Response=HASH(0x8380464) : : Here's the code snippet: : : $file = "/home/images/$name"; : open(IMAGE, ">$file") || die "unable to

Re: Probably a "no-brainer" - the last two messages.

2001-06-05 Thread Timothy Kimball
Gary Luther wrote: : 56open(CD, ">$cdate") || "Can't open $cdate: $!"; : 60open(CN, ">$cnum") || "Can't open $cnum: $!"; I think you mean open(CD, ">$cdate") || die "Can't open $cdate: $!" Without the die(), you have a string just sitting there, being useless. -- tdk

RE: Loading images with CGI.pm...Rephrased

2001-06-05 Thread Timothy Kimball
Rich Fernandez: : Is there an advantage to using "read", as you did above, as opposed to : just saying: : : while(){print;} : close MOVIE; : : Or is it just a case of TMTOWTDI? It's more efficient to read() binary files than to loop through them with <>. "while (<...>)" is good for text fil

Re: CGI-BIN

2001-06-05 Thread Timothy Kimball
Randal L. Schwartz: : I'm not sure why people are still so entranced by the use of the : word "ScriptAlias". Not to mention that ScriptAlias is something : only the webmaster can edit, not general users, since it's illegal : to use in an .htaccess file. : ... : So, for example, if you wanted ~me

RE: Loading images with CGI.pm...Rephrased

2001-06-05 Thread Timothy Kimball
Rich Fernandez wrote: : Thanks for your responses but : I guess I wasn't clear enough with my original question. Sorry. : Let me try again... oops, sorry about that... didn't read your code fully. : I _already_ have a link on my page that says : http://gromit/cgi-bin/juggling.pl?video=rr.mpg> :

Re: Loading images with CGI.pm

2001-06-05 Thread Timothy Kimball
Rich Fernandez wrote: : I'm playing around with a web page that serves up an image or video file. : If I use straight HTML I can create a link that says something like "" and have the video display when the link is clicked, but I : can't get the right syntax using CGI.pm. Probably trivial, but...

Re: newcounter(was did i do that correctly)

2001-06-05 Thread Timothy Kimball
: here is the program in full so you may verify i did it correctly (i'm = : sure there was a shorter way, but right now i'm just trying to get the = : darn thing to work!!!) But now an error of an uninitialize value in 46 = : &51 occurs and I don't know what to do..please assist? I marked them =

RE: Records put into a hash - Beginner Question

2001-06-04 Thread Timothy Kimball
Joel Stout wrote: : Many thanks, one last tidbit: : Is it better to : : : %Fields = %{$Accts{$account}}; : foreach $name ( keys %Fields ) { : : print "$name : $Fields{$name}\n"; : } : : or : : foreach $name ( keys %{$Accts{$account}} ) { : : print "$name : \n"; : : } I'd say i

Re: Records put into a hash - Beginner Question

2001-06-04 Thread Timothy Kimball
Joel R. Stout wrote: : #But when I try to pluck a fields value out, I get hosed : : foreach $account (keys %Accts) { : print "Fields: \n"; : foreach $name (keys $Accts{$account}) { : #here's where my brainstorming turns into a light sprinkle : #there's a scalar here

RE: perl ping script using cgi

2001-06-01 Thread Timothy Kimball
Dave Palmer wrote: : Your working script is *definitely* the way you want to go... its generally : a no-no to ever give user 'nobody' (e.g. web server) access to your shell : (which is what is happening with the system() call). I wouldn't be so restrictive about it; sometimes it's necessary to

Re: HTTP::Date???

2001-06-01 Thread Timothy Kimball
Peter Scott wrote: : Okay, I geddit... it's because HTTP::Date is required by CPAN.pm (perldoc : -m CPAN | grep -i http). So perl sees the module name as being one it : already knows of and turns it into the indirect object syntax as you say. OK, that makes more sense. (I wasn't entirely comf

Re: printf and other stuff

2001-06-01 Thread Timothy Kimball
David Gilden wrote:: ##this does not work : : print ($sort_order) ? 'Newest First' : 'Oldest First'; Perl thinks you're doing this: print($sort_order) ? 'Newest First' : 'Oldest First'; that is, it's taking $sort_order as an argument to print(). Either remove the parens: print $sort_ord

Re: HTTP::Date???

2001-06-01 Thread Timothy Kimball
I replied: : Dan Egli wrote: : : It's odd tho. I type: : : : : perl -MCPAN -e 'install GD' and it works fine. Only with thinks like : : HTTP::Date and Data::Dumper does it work. I'm not sure whats up. : : I get the same result with Data::Dumper & 5.6.0 unless I quote : the module name: : : per

Re: HTTP::Date???

2001-06-01 Thread Timothy Kimball
Dan Egli wrote: : It's odd tho. I type: : : perl -MCPAN -e 'install GD' and it works fine. Only with thinks like : HTTP::Date and Data::Dumper does it work. I'm not sure whats up. I get the same result with Data::Dumper & 5.6.0 unless I quote the module name: perl -MCPAN -e 'install "Data::Dum

Re: Sorting a hash by value, and displaying the key

2001-05-31 Thread Timothy Kimball
Paul Hodges wrote: : Try flipping the hash. : : my %flipped; : @flipped{values %HASH} = keys %HASH; : : That makes the keys of %HASH the values of %flipped, with the matching : values of %HASH being the keys to which they are assigned. : Now just do it the easy way. : : for my $key (sort ke

Re: Sorting a hash by value, and displaying the key

2001-05-31 Thread Timothy Kimball
David Michael wrote: : I have a hash that needs to be displayed in a certain order. I tried : : foreach $key (sort (keys %HASH)) { : print $key; : } : : that sorts alphabetically. I need it in the order it was inserted, so I made the :value a number that increased f

Re: test for real number

2001-05-31 Thread Timothy Kimball
Randal L. Schwartz wrote : For integers, you can narrow it down: : : sub is_integer { : my $bad = 0; : local $SIG{__WARN__} = sub { $bad++ }; : local $^W = 1; : my $guess = shift; : return $guess == int($guess) and not $bad; : } oops, precedence: return $g

Re: Regexp - missing matches

2001-05-25 Thread Timothy Kimball
Craig Moynes wrote: : $params{f} = "%E %e %d"; : output: : %E %e %d : %d : : So %e is not found : : $params{f} = "%d %e"; : output: : %d %e : %e I can't reproduce this error with the code you posted. Here's the script I tried: #!/faxafloi/data1/bin/perl use Getopt::Std; use strict; my @ma

Re: NDBM Error

2001-05-25 Thread Timothy Kimball
Geraint Jones wrote: : "ndbm store returned -1, errno 0, key "C4842AE" at : /usr/local/httpd/cgi-bin/ism-web.pl line 49." : : This is the offending line: : : $STOCK{$act_on} += $val; Does the user that your CGI script runs as have write permission on the dbm file? -- tdk

Re: Modifying/Deleting lines in a file

2001-05-24 Thread Timothy Kimball
David Blevins wrote: : There has to be a better way to modify/delete lines in a file than this. Time for a one-liner: perl -ni -e 'print unless /I'm a bad line, delete me\./' thefile -n loops through the lines of thefile, but doesn't print them unless you ask -i edits thefile in place -e mea

Re: pop up alert

2001-05-24 Thread Timothy Kimball
Sigrid Kelsey wrote: : I would like an alert to pop up everytime someone accesses a certain cgi : script (I'm new at this). I have commented out my lame attempts that don't : work below, but I think they will show what I'm trying to do. : : #! /usr/sbin/perl : : #print " : # alert('MESSA

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
Stephen Neu wrote: : ... Otherwise, you have code that needs to : find Perl so it can run the code that needs to find Perl so it can run the : code that needs to find Perl so it can... etc. Or you can run "perl" on a fixer script and have it edit the script for you. That's what my solution doe

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
Neville hobson wrote: : I'm writing perl scripts that will be distributed to locations where I : cannot gaurantee the location of perl. Is there a clean alternative to the : shebang with the specific perl path? Maybe using an environment variable to : locate perl? OK, here's one solution, extrac

Re: Why can't $I = chop $array[1]

2001-05-24 Thread Timothy Kimball
Me wrote: : > n.b. chop() removes the last character; chomp() removes the last : > character only if it's a record separator (defined in $/). Either one : > will return the character chopped. : : Nah, chomp() returns number of chars dropped. You're right. I just get tired of looking everything

Re: Problems with split

2001-05-24 Thread Timothy Kimball
: what should be $router_table{$i} ? Sorry for the typo. Should be $router_tables{$i}. In the code you posted, you don't have a dollar sign on the i. -- tdk

Re: Why can't $I = chop $array[1]

2001-05-24 Thread Timothy Kimball
David Blevins wrote: : I'm wondering, why can I do this: : : local @fileList = reverse sort `ls $list*.list`; : local $current = $fileList[0]; : local $previous = $fileList[1]; : : chop $current; : chop $previous; : : But, not this: : local @fileList = reverse sort `ls

Re: Is there an alternative to #!/usr/bin/perl

2001-05-24 Thread Timothy Kimball
: I'm writing perl scripts that will be distributed to locations where I : cannot gaurantee the location of perl. Is there a clean alternative to the : shebang with the specific perl path? Maybe using an environment variable to : locate perl? This may be a heavier solution than you were looking

Re: Problems with split

2001-05-24 Thread Timothy Kimball
Andy Roden wrote: : For some reason, the script doesn't execute the split as I would hope : (giving $router_table{i} = 1.1.1.1 $router_type{i} = cisco) it just : returns two blanks (and hence prints out the $router_tables{$i} as its : told to Should be $router_table{$i}, shouldn't it? -- tdk

Re: $! after using backticks

2001-05-23 Thread Timothy Kimball
Ron Mitchell wrote: : I want to check that a backtick command has executed OK. I thought I could : do that by looking at the $! variable. Check $? instead. This one's for pipes, backticks, & system() commands. It's a fairly complex flag, with a lot of stuff in it, but briefly, $? >> 8 contains t

Re: New line in Regular expression.

2001-05-23 Thread Timothy Kimball
japhy wrote: : On May 23, Timothy Kimball said: : : >2. Use the "s" modifier to treat the slurped-up file as a single string. : : The /s modifier changes the meaning of . only, and not ^ or $ -- see my : response. I stand corrected. In my defense, I don't use either of the

Re: Regrex question

2001-05-23 Thread Timothy Kimball
: ### Does not work want to count the number of matches... : $regex= ($test=~ s/(dav)/$i++ $1/eig); : : print "$regex $i\n"; : : ### This does work.. : $regex= ($test=~ s/(dav)/$1 Smith/ig); : : print "$regex\n"; : : __END__ : : : It looks like $regex contains the number of matches,

Re: New line in Regular expression.

2001-05-23 Thread Timothy Kimball
: this is what i tryed on the command prompt. : : perl -pi -e 's{^

Re: Regular Expressions

2001-05-23 Thread Timothy Kimball
Stefan Kyrytow wrote: : As you can see the last two inputs should not be accepted. I am using $x =~ : /[0-9]/ as my filter. I understand why the values are being accepted, I am : searching for a number and 12bob & bob12 each contain a number. : : What I do not understand is how to search for jus

Re: psgrep from Perl Cookbook

2001-05-23 Thread Timothy Kimball
Ron Yacketta wrote: : I finally got a few books from O'Reilly, I truly am enjoying reading "Perl : Cookbook" : I was wondering if any of these complete scripts are available online for : download? All the examples from the book are available as a .tzr.gz or .zip file from http://examples.oreilly

Re: Require

2001-05-22 Thread Timothy Kimball
john wrote: : It seems like using 'require' is the way to go (since I don't have the time or : experience to do modules at the moment). : : I can get the required scripts and subroutines to call OK when there is only one : sub per required file and I don't have to pass arguments. : : When I try

Re: Passing command line arguements

2001-05-22 Thread Timothy Kimball
Dan Brown wrote: : If it really is a script written for cgi, sending arguments via command : line won't work. When a cgi script runs information is available to : that script because the web server provides an environment from which : the script can access the information. If the script is writ

RE: Multiple submit buttons CGI question

2001-05-22 Thread Timothy Kimball
Aaron Craig wrote: : I believe multiple submit buttons only send off the information for the : form they are a part of. If you have multiple forms, clicking one submit : button will only get you that form sent off. This is true (unless you're into Javascript). However, a single form can have

Re: Multiple submit buttons CGI question

2001-05-22 Thread Timothy Kimball
Dave wrote: : Can any one tell where I went wrong here? : (I remember reading that a html form can have : multiple submit forms as long as you parse them : via their value) : ... : In the html: : These tags need a name attribute. Without it, the values will not be bound to a CGI parameter nam

Re: Dynamic regular expressions

2001-05-22 Thread Timothy Kimball
Robin Lavallee wrote: : On the command lines, the following happend : : allo al => match : allo /al/ => no match (should match, no ?) No, because "allo" doesn't contain any slashes. : allo lo$ => match : allo ^al => match : allo ^ao$

Re: Form processing - redirect?

2001-05-21 Thread Timothy Kimball
Gary Madden wrote: : In response to a user filling out and submitting a form, I want to send : the user an HTML page whose URL I've stored as a hidden value on the : forms page instead of creating the page within the cgi script. (The : other functions of my script work properly.) This way the pag

Re: use lib directive

2001-05-21 Thread Timothy Kimball
I wrote: : If you did, then did you use the same perl executable to install the : module that you're using to run it? i.e., does 'which perl' eq the : shebang line of your script? If you have two perls on your system : (seems a lot of people do), then it may be that the other module isn't : inst

Re: use lib directive

2001-05-21 Thread Timothy Kimball
Peter Cline wrote: : Hello, I am attempting to develop my first module. Because of : permissions/security, etc.. I cannot store the module in the standard perl : lib directories. So it is currently living in a subdir called lib in my : home directory. I use a "use lib" directive to add thi

Re: Help with CGI script

2001-05-21 Thread Timothy Kimball
Damien wrote: : open ARTICLE, "$bkup_dir/$artid.data" or die "Could not open article data file :$bkup_dir/$artid.data: $!\n"; By the way, if the die() message doesn't end in a newline, then die() will tell you what line of what script it died on. This is invaluable for debugging. -- tdk

Re: Help with CGI script

2001-05-21 Thread Timothy Kimball
Damien wrote: : ... : So here are the files, and I home someone can help :) : ... It would be a lot more useful if you could get the error message in your server's error log. Find out where this is and tattoo that location on the inside of your eyelids. The error log is a CGI programmer's best f

Re: using GET and parsing content.

2001-05-21 Thread Timothy Kimball
Jeff wrote: : open(DOM, GET 'http://URL') || "unable to open website\n"; : : The GET here doesn't actually get the results it just dumps the : main URL not the results. If you're using the GET method from HTTP::Request::Common, then that's all it will return, the URL. It's encapsulates the requ

Re: Beginner question

2001-05-21 Thread Timothy Kimball
: if ($oldLot[1] == 0) : { : $arpCount = $arp{$lot}; ==> Part 1 : } : else : { : $arpCount = "-"; ==> Part 2 : } : : printf "%3s %3d ", $arpCount, $count; : : My problem occurs in the "printf" at the "%3s". Here : is the situation: When $oldLot[1] == 0, $arpCount is : equal to

Re: Version from Apache

2001-05-21 Thread Timothy Kimball
: How I get the version from apache?? Try $ENV{SERVER_SOFTWARE}. If you're using mod_perl, there's a SERVER_VERSION in Apache::Constants. -- tdk

Re: passing array values into a command string

2001-05-18 Thread Timothy Kimball
Jason wrote: : while () {# read the names into a hash : $names{$_} = 1; : } Maybe do a chomp() in here? while () { chomp; $names{$_} = 1; } Otherwise, it might be trying to match the newline (which Perl retains). -- tdk

Re: REVIEW: please review the following

2001-05-18 Thread Timothy Kimball
212 open(RPT, ">>$REPORT") or die "Can't open $REPORT: $!"; ... 221 system "echo \"Starting WKI clone process for $DATE on `date`\" >> $REPORT"; So you open $REPORT for appending, and then echo into it? Why open it in the first place? Also, it seems a bit risky, especially since the

Re: script review

2001-05-18 Thread Timothy Kimball
Ronald J. Yacketta wrote: : Do you mind if I post a script I have been hacking away at for a week or so : now? hmmm, an online code review. Sounds like Open Source. ;) Yeah, post it. -- tdk

Re: copying an array

2001-05-18 Thread Timothy Kimball
Edson Manners wrote: : I'm currently copying two 1-dimensional arrays using : for loops. Is there an easier way as this may tag my : cpu due to the huge numbers I am using. @copyOfArray = @array; is the usual way to copy arrays. Question., though: Is it absolutely necessary to copy the arrays f

Re: problem with environment variable

2001-05-18 Thread Timothy Kimball
: $hostadd = $ENV{REMOTE_HOST}; : : print "Host : $hostadd\n"; : : But it isnt working , all I see is : : Host: Your server (I'm assuming Apache) may be configured with: HostnameLookups Off If this is the case, then the server will not try to resolve IP addresses into hostnames. This i

Re: Quick rounding to nearest integer

2001-05-18 Thread Timothy Kimball
Jos Boumans said: : try to take a look at the 'floor' and 'ceil' in the posix module : : they will do exactly what you want! Not quite. They don't round, they truncate: round floor ceil 10.010 10 10 10.210 10 11 10.711 10 11 Now Craig said: : I have an nu

Re: Counting and sorting an array

2001-05-18 Thread Timothy Kimball
Slight correction: : pushd @petcounts, sprintf "<%d> %s%s", should be push @petcounts, sprintf "<%d> %s%s", -- tdk

Re: Counting and sorting an array

2001-05-18 Thread Timothy Kimball
: I would like to sort an array like this : my @pets = {$cat, $dog,$camel,$camel,$camel,$dog} : and then to have it printed out in the order of occurrences : print "I will give you <3> camels, <2> dogs, <1> cat " for the blond one Well, first of all, what you have there isn't really an array.

Re: Quick rounding to nearest integer

2001-05-18 Thread Timothy Kimball
: Is there an easier way (or more efficent). This is more a curiosity than : anything else. Easy and efficient, as long as $archives_needed is always positive: $archives_needed = int($archives_needed + 0.5); Otherwise, if $archived_needed can be negative: $archives_needed = int($archives_nee

Re: elegant REGEX

2001-05-18 Thread Timothy Kimball
: can any one suggest me a REGEX to catch the numbers in the following : input line: : test case total : 32456 allocated : 12000 from tech : : I want to catch the two numbers and insert them to vars Elegant? Regex? ;) $line = 'test case total : 32456 allocated : 12000 from tech'; ($n1,$n2) =

Re: Re[2]: flush - ?

2001-05-18 Thread Timothy Kimball
: I'm sorry, I might sound lame, but these buffering and autoflush problems seem a :bit(?) theoretical and far-fetched to me. Would you please show me examples of :situations (or links to codes) where the use of autoflush instead of buffering IO (or :vice versa) would be crucial. One area is

Re: help with arrays

2001-05-17 Thread Timothy Kimball
: the above works fine and dandy (I think) : but when I replace the print in the for() with a system call as such : system "mminfo -a -r \"volume,mediarec,ssid,name\" -q \"location=sun_etl\" : -V -o tR -c $_ >> out"; : I get a broken pipe and the output from the mminfo command is spewed on the :

Re: foo bar?

2001-05-16 Thread Timothy Kimball
: Maybe a silly question but where does foo-bar or foobar refer to? : : Everyone uses it in perl, but I cannot find the origin of it. See the entry in the Hacker Jargon file: http://www.tuxedo.org/~esr/jargon/html/entry/foo.html -- tdk

Re: Perplexing problem.........probably beginners luck??

2001-05-15 Thread Timothy Kimball
: Why does reading into a variable instead of $_ make a difference? : Why does the read for the date work with $_ just fine?? In the second example, change ; to $_ = ;. The angle operator only assigns the next line to $_ when it's the only thing in the conditional of a while() statement. As a

Re: Breaking up a file.

2001-05-14 Thread Timothy Kimball
: my @sections = split /\n(?=[a-z])/i, $dat; : I have a doubt here. perldoc -f split says, : -- : If the PATTERN contains parentheses, additional array : elements are created from each matching substring in the : delimiter. : : split(

RE: Loading extra modules.

2001-05-09 Thread Timothy Kimball
: > perl Makefile.PL : : make : : > make test : > make install {su'ed to root} When you do "make test" and you haven't done "make", "make" will be done automatically. -- tdk

Re: Loading extra modules.

2001-05-09 Thread Timothy Kimball
: Apparently, even if I give PREFIX= as a command line param, you get the : following errors: : Skipping /home/tir/COMP/perl/modules/lib/site_perl/5.005/Date/Manip.pod (unchanged) This means that Perl didn't bother to install Manip.pod because there was one already there that was exactly the s

Re: Loading extra modules.

2001-05-09 Thread Timothy Kimball
: Folks, how do I load extra modules? I got Date::Manip today, and I know I : should be putting it in the search-path of perl (@INC ?), but how do I do : it? Can I get a small code snippet? : : I do not have su privileges on the machine I work, and would like the : search-path to have my module

Re: mv'ing a file from within perl (w/out /bin/mv)

2001-05-09 Thread Timothy Kimball
: I just want an efficient mv subroutine or module which has such a thing, : but none of the File::* things seem to have mv. perldoc -f rename -- tdk

Re: nested each(%hash) question

2001-05-08 Thread Timothy Kimball
: > I have 2 hashes, %one and %two. : > : > the ($key, $value) of %one is a span of time. : > : > I need to compare this span of time over every $key of %two. : : ... : : Look at the replies given here earlier. : I ran some benchmarks with while and grep, and your while loop didnt look : less e

Re: nested each(%hash) question

2001-05-08 Thread Timothy Kimball
: I have 2 hashes, %one and %two. : : the ($key, $value) of %one is a span of time. : : I need to compare this span of time over every $key of %two. : : Here's what I have: : : while (($key1, $val1) = each (%one)) { : : while (($key2, $val2) = each (%two)) { : : if (($ke

Re: Parsing a string....

2001-05-07 Thread Timothy Kimball
: I have thought about tackling this using the regexp (%\w) using the : grouping and getting each match with $n (where n is a number) but I can't : seem to get the regexp to match more than the first match. Have you tried using the "g" regex option? e.g., /.../g -- tdk

Re: scalar vs. vector context

2001-05-07 Thread Timothy Kimball
:@possWords = push(@possWords,$temp) ; This line is the problem. push() returns the number of elements in the array after the new elements have been pushed onto it. Get rid of the "@possWords = " part of this line. -- tdk

Re: More hash trouble

2001-05-07 Thread Timothy Kimball
: >Would it also be wise to use the qr// ? : > : >Such as: : >my $shortDayName = qr/(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/; : > : >then for example I could do: : >my $abcXYZ = qr/$shortDayName ABC/; : : You don't need to use the ()'s in the regex if you don't plan on capturing : anything, by

Re: More hash trouble

2001-05-07 Thread Timothy Kimball
: $self->{DF_SPEC} = { : ... : c => "$self->{DF_SPEC}{a} ...", : : }; : : print "$self->{DF_SPEC}{'b'}\n"; : print "$self->{DF_SPEC}{'h'}\n"; : : : Produces the output: : (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) : : : Any ideas ? You're trying to use parts of the $se

Re: Environment variable question

2001-05-04 Thread Timothy Kimball
: I am required to modify an Environment variable from one value to another : using perl script. I can access the env. variables in the perl : script using ENV. How can i modify so that when I exit my perl script -- the : env. variable has new value. You can't. Perl scripts are child processes o

Re: filehandle question

2001-05-04 Thread Timothy Kimball
: is it possible to open a filehandle on a file change one line in that file : without outputing to another file. You can open the file, seek() to a particular position in it, and start overwriting the file at that position, but when you reach the end of that line, you'll keep on writing past it

Re: Hash help

2001-05-04 Thread Timothy Kimball
: I declare my hash like this: : : my ( %FS_XCPTN ); # hash table, key is mount point, : # value is FS's special case H_LIMIT and : C_LIMIT : : I use it like this: : $FS_XCPTN{$mntPoint} = { :

Re: Need help with forms and files

2001-05-04 Thread Timothy Kimball
: I am trying to append to an existing database and my cgi keeps coming up : with an Internal Server Error. I've looked this over many times with : different books as references, and I can't see what is wrong with it. My : form method is POST. Here is my code: My money's on you not being able to

Re: Nested Hashes Help

2001-05-04 Thread Timothy Kimball
: Now the only way I have figured out how to access it is with this ugly : string: : print "${%{$self{DF_SPEC}}}{'a'}\n"; Try print "$self->{DF_SPEC}{a}\n"; -- tdk

Re: to have URL's call

2001-05-03 Thread Timothy Kimball
: How can I have the URL which is calling my script? : : ex: : the name of my script is : "script.cgi" : URL is : http://www.computer.com/script.cgi?toto=12&titi=25 : I want to have $var=toto=12&titi=25 or $var=http://iti=25 . I think this would be web-server/platform dependent, but under

Re: Formular

2001-05-03 Thread Timothy Kimball
: I have a formular with 3 text input fields ( name, fullname, and street ) : and 2 submit buttons.The first submit button start a perl-script "work.pl" : and the second submit button start an another perl-script "checkup.pl" : Now, I don't know, how to make one formular with 2 submit buttons, w

Re: String deconstruction?

2001-05-02 Thread Timothy Kimball
: > substring => sub {for (0..length($x) - 1){$q = $_ }} This one isn't getting the characters from the string, it's just counting from zero to one less than the length of the string. -- tdk

Re: String deconstruction?

2001-05-02 Thread Timothy Kimball
: Hello. I am attempting to print a string one character at a time. Right now I am :using one while loop with chop to create a new string, the reverse of the original :string, then another while loop with chop on the reversed string to print out the :characters. I'm sure there's a more stra

Oracle/CGI/Perl (was: RE: I am a real begginer to perl......)

2001-05-02 Thread Timothy Kimball
: I am also a beginner and wondering if there are any other recommended : books other than the camel book from O'Reilly. I have been asked to : display information from the Oracle Database on the web using Perl and : CGI. So far, I mostly know how to check for patterns. Gulp!! O'Reilly has al

Re: eliminating duplicate lines in a file

2001-05-02 Thread Timothy Kimball
brahmanyam <[EMAIL PROTECTED]> wrote: : > Hi, : > Iam reading flat text file of 10 lines. Each line has got data of : > maximum 10 characters. : > I want to eliminate duplicate lines and blank lines out of that file. : > i.e. something like sort -u in unix. : : Got plenty of memory? =o) : :

Re: Outputting content to the web

2001-05-01 Thread Timothy Kimball
: #!usr/bin/perl Shouldn't this be #!/usr/bin/perl -- tdk

Re: IF statements

2001-05-01 Thread Timothy Kimball
: I think what I need is something called a case. but I can't find the syntax : anywhere. Perl doesn't have an official case (that is, switch) statement, but there is a Switch.pm module available on CPAN. Here's the synopsis from its manpage: use Switch; switch ($val) {

Re: Got a project for Perl but need some help

2001-04-30 Thread Timothy Kimball
: Just curious, how would you send an attachment? The MIME::Lite module can do this. -- tdk

  1   2   >