RE: PPM3 - libwww-perl

2002-07-03 Thread Hanson, Robert
I didn't see any libwww on their site... are you sure that they have it for download? ActiveState only has a limited module repository. http://www.activestate.com/PPMPackages/5.6plus/ Rob -Original Message- From: Nigel Peck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002

RE: Object-Oriented DBMS

2002-07-02 Thread Hanson, Robert
The Perl Journal had a nice article on an OODBMS engine used by the Human Genome project called Ace. It's free and has a Perl interface. http://www.samag.com/documents/s=1290/sam04010004/ Rob -Original Message- From: anthony [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 30, 2002 1:36

RE: URGENT. Re: multi-line regex question, please help!

2002-07-02 Thread Hanson, Robert
...how to execute a ***multi-line*** match. $_ =~ s/^(M\d+)\n^(.*)/A $1\nB $2/mi; ...i am trying to match the first line, beginning with M followed by consecutive digists... You are confused about what a multi-line match is. A multi-line match will attempt a match on ONE line at a time.

RE: Beginner with a somewhat advanced question.....

2002-07-02 Thread Hanson, Robert
The script looks ok to me, so you might need to debug the input values and the data it is drawing from. This is probably where the problem is: $sql = select * from product,order_line where prod_num = product_id and order_num = $order_id; If you can, print the value of $sql and then run the

RE: debug function for use?

2002-07-02 Thread Hanson, Robert
I'm a debugger newbie, so I'm not sure what x does... but pretty-printing can be done with Data::Dumper. use Data::Dumper; my %hash = ( foo = 1, bar = [1,2,3,4], baz = {a = 1, b = 2} ); print Dumper \%hash The output of Dumper will be nicely formatted Perl code to recreate the data structure.

RE: invalid

2002-06-27 Thread Hanson, Robert
It depends on what include is. If it is a subroutine... $content2 = include(helpdesk/support.cgi); If it is a hash... $content2 = $include{helpdesk/support.cgi}; And what was the error? Rob -Original Message- From: Kyle Babich [mailto:[EMAIL PROTECTED]] Sent: Thursday, June

RE: Perl Win32 Application.

2002-06-27 Thread Hanson, Robert
wxPerl looked pretty good, but I never did more than just play around with it. The thing I like it that it will use the builtin Windows widgets, so it looks like an ordinary windows app (Win32::GUI will as well). Here is an article on it, decide for yourself.

RE: Regex question again

2002-06-27 Thread Hanson, Robert
But how do I let it make : $dir = /IPlib/and/many/other/dirs; ## But now on the first dir $dir =~ s!^[^/]*!!; ^ = Beginning of the string. Rob -Original Message- From: David vd Geer Inhuur tbv IPlib [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 11:15 AM To: [EMAIL

RE: Saving in RTF

2002-06-27 Thread Hanson, Robert
RTF is just plan text with a lot of markup, it isn't a binary file like a Word doc. You should be able to just drop it into a text (or is it called memo in MySQL?) field. Rob -Original Message- From: João Paulo [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 12:41 PM To:

RE: uninitialized value?

2002-06-26 Thread Hanson, Robert
Premature end of script headers: This could be a lot of things. Use of uninitialized value in string eq at index.cgi line 14. This is merely a warning, not an error. This won't cause a script to fail (see perldoc perdiag). The real error (the first one) isn't giving you any clue.

RE: uninitialized value?

2002-06-26 Thread Hanson, Robert
have other scripts that you know are working fine. Rob -Original Message- From: Kyle Babich [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 8:34 AM To: Hanson, Robert Cc: [EMAIL PROTECTED] Subject: Re: uninitialized value? Actually I do have the content-type printed: #!/usr/bin

RE: CPAN Modules

2002-06-26 Thread Hanson, Robert
The biggest reason (for me) is that you want the module to test itself. It will also inform you if you don't have all of the prerequisite modules. Besides that, it's easier than copying it once you get used to it, and don't forget that copying won't autosplit the module if that is what the

RE: getting data from one table, putting it into another...

2002-06-26 Thread Hanson, Robert
Always use placeholders, this should help... my @abfrage = $sth-fetchrow_array; # build placeholders based on num of fields my $placeholders; $placeholders .= ($placeholders ? ,? : ?) for (@abfrage); my $sth2 = $dbh-prepare(INSERT INTO board $placeholders); $sth-execute(@abfrage); The problem

RE: Pattern Matching

2002-06-25 Thread Hanson, Robert
This will work... /\[.*?\]/ The .*? means match any character any number of times... BUT be non-greedy about it. The ? is what makes it non-greedy, and that means it will attempt to match as few characters as possible. ...So in essence this says match an open bracket up to the first closing

RE: RegEx to match Valid IP Address

2002-06-14 Thread Hanson, Robert
You could either roll your own or use Regexp::Common. http://www.cpan.org/modules/by-module/Regexp/Regexp-Common-0.01.readme It might look like this... (?:[1]?\d{1,2}|2[0-4]\d|25[0-5]\.){3}[1]?\d{1,2}|2[0-4]\d|25[0-5] Or something like that. Rob -Original Message- From: Tim

RE: parsing a variable

2002-06-14 Thread Hanson, Robert
Here is one solution... For each item in @offline the MAC will be captured in the variable $1. # untested... for ( @offline ) { if ( /((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ ) { print MAC: $1\n; } else { print No MAC here\n; } } Rob -Original Message- From: Tucker,

RE: parsing a variable

2002-06-14 Thread Hanson, Robert
How about this? # untested my @mac = map {/((?:[a-fA-F0-9]{4}\.){2}[a-fA-F0-9]{4})/ and $1} ( @offline ); Rob -Original Message- From: Tucker, Ernie [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 11:37 AM To: Hanson, Robert; Tucker, Ernie; [EMAIL PROTECTED] Subject: RE: parsing

RE: Having problems with login

2002-06-12 Thread Hanson, Robert
First of all I would strongly recommend using DBI for this. It will allow you to use flat files now then upgrade to a database later with almost no code changes. That being said, there are a few ways you can do this, the simplest being this: # untested my $valid_user = grep

RE: Using ARGV

2002-06-12 Thread Hanson, Robert
@ARGV contains all of the arguments passed, and you only want to print the first, so you need to specify that. $test = $2 $ARGV[0]; # 0 is the first element Rob -Original Message- From: phumes1 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 9:49 AM To: [EMAIL PROTECTED]

RE: Spaces...

2002-06-10 Thread Hanson, Robert
Try /\s+/ From the perlre manpage: \s Match a whitespace character + Match 1 or more times Rob -Original Message- From: Fontenot, Paul [mailto:[EMAIL PROTECTED]] Sent: Monday, June 10, 2002 1:02 PM To: Perl - Beginners (E-mail) Subject: Spaces... I have a logfile that has the

RE: debugging statements and such

2002-06-07 Thread Hanson, Robert
Well you could toy around with source filters. A source filter allows you to manipulate your code after it is read into memory but before it is executed. Here is a good article on it, and even has an example of handling debug output. http://www.samag.com/documents/s=1287/sam03030004/ You

RE: :CSV

2002-06-07 Thread Hanson, Robert
As an alternative you could use Text::CSV to split the fields. Rob -Original Message- From: Jason Frisvold [mailto:[EMAIL PROTECTED]] Sent: Friday, June 07, 2002 9:36 AM To: Beginners@Perl. Org (E-mail) Subject: DBD::CSV Is anyone here familiar with DBD::CSV? I seem to be hitting a

RE: regex

2002-06-07 Thread Hanson, Robert
I think what you want is [^']* , meaning anything except single quote = zero or more times. Like this... my $line = 'here is a quote'. Autor (birth year - death year); occupation nationality.; $line =~ /'([^']*)'/; print $1; Rob -Original Message- From: Eduardo Cancino [mailto:[EMAIL

RE: Regex Problem - please help

2002-06-05 Thread Hanson, Robert
Here is my solution, others will differ... # always print $! on error so you can see the cause open( INFILE,books.txt ) || die Cann't Open: $!; while( INFILE ) { chomp; # remove the newline next unless ($_); # skip blank lines # split the line by the seperator

RE: Storing variable names in strings

2002-06-03 Thread Hanson, Robert
I think the general answer you will get is don't do it that way for various reasons. It is only ever a good idea if there are absolutely no alternatives, and even then you should always rethink doing it that way. This code will do exactly the same thing except it uses keys in a hash to give you

RE: Day Month Issues

2002-06-03 Thread Hanson, Robert
You are running with warnings turned on, and Perl is just warning you that you *might* have made a mistake by creating a variable then not using it. In this case it isn't a mistake, but it will still warn you about it. Snippet from perldoc perlrun -w prints warnings about variable names

RE: simple array question

2002-05-21 Thread Hanson, Robert
Sure. @main = (@data1, @data2, @data3); Rob -Original Message- From: A Taylor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 10:05 AM To: [EMAIL PROTECTED] Subject: simple array question Hi all, I have a very simple and probably stupid question to ask. If I have a set of

RE: Reverse sort?

2002-05-21 Thread Hanson, Robert
To expand on that, the = operator is for numeric comparisons and cmp are for string comparisons... make sure you use the right one. This may also work for what you need... @items = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); @sortedItems = reverse( sort(@items) ); Rob

RE: Calling subroutines...

2002-05-20 Thread Hanson, Robert
There are lots of ways to do this, but this is an easy one to understand... Calling_sub($var1, $var2); sub Calling_sub { my ($subvar1, $subvar2) = @_; print $subvar1; print $subvar2; } Explaination - When you call a sub the parameters are passed via a special array named @_. Perl puts

RE: Pattern Matching...again...

2002-05-20 Thread Hanson, Robert
A few things... If ($var1 =~ /\b$var2?\b/I) { ^^ it should be if not If If ($var1 =~ /\b$var2?\b/I) { ^ The switch is i not I Print cannot contain that word.\n; ^ the p in print is lower case (are you using Win32::ASP?) if ($var1 =~ /\b$var2?\b/i) {

RE: Perldoc

2002-05-16 Thread Hanson, Robert
The perldoc manpage is about the perldoc utility... perlpod talks about the Plain Old Documentation (pod) format. So I think perldoc perlpod is what you are looking for. Rob -Original Message- From: Jackson, Harry [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 16, 2002 9:48 AM To:

RE: Help with my first package??

2002-05-15 Thread Hanson, Robert
What is the error? Rob -Original Message- From: Miretsky, Anya [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 15, 2002 4:16 PM To: '[EMAIL PROTECTED]' Subject: Help with my first package?? I am trying to write a package that will execute a sql statement for me in my cgi pages, the

RE: 'my' variables

2002-05-14 Thread Hanson, Robert
what about variables used just within the function Unless there is a good reason for it, all variables inside a function should be declared inside of the function by using 'my'. ...If you can't think of a good reason not to use 'my', then you should use it. What do you mean 'pass by global

RE: Books

2002-05-14 Thread Hanson, Robert
If you are still learning, the second edition is sufficient as a resource, although the 3rd edition is a better read (IMO). As far as what has changed from then to now, it really isn't anything that would be covered in Learning Perl anyway. Perl 5 is basically Perl 5, especially when it comes

RE: another cgi error question

2002-05-10 Thread Hanson, Robert
No, I don't believe it is standard. Type this at the command line, it will answer most if not all of your questions... perldoc -q cpan If you still have questions after that, just ask. As a side note, if you are using ActivePerl in Windows read this as well perldoc ppm. Rob

RE: apache::session

2002-05-09 Thread Hanson, Robert
The short version... 1. get the cookie from the user (using CGI.pm or other mod). 2. tie hash to Apache::Session passing a database handle and the cookie val. 3. set or refresh the cookie with the session ID (from Apache::Session). 4. store and fetch to the tied hash. Rob -Original

RE: @INC

2002-05-06 Thread Hanson, Robert
There are a few ways listed in the FAQ's. perldoc -q search word will search the FAQ's on a specific word. Below is what was found when I searched on the word library. Depending on your needs using the PERL5LIB environment variable might be the best option (Just create a new environment

RE: simple problem

2002-04-29 Thread Hanson, Robert
if ( $tablename 1){ Why would $tablename be a number? Is this really what you want? Maybe you really wanted to check the length? if ( length($tablename) 1 ) Or a little better if ( length($tablename) ) Or better yet if ( $tablename ) Rob -Original Message- From:

RE: RegEx question

2002-04-23 Thread Hanson, Robert
tr/// translates from one character to another. So fo each + it finds it translates it to a space. The purpose of tr/// is to be able to give it one or more characters in the left part of the match and one or more characters on the right side, and it will translate each char on the left to the

RE: How to test if a module is installed ?

2002-04-19 Thread Hanson, Robert
Something like this should work... if ( eval require Image::Size ) { Image::Size-import(); print The module is installed!; } else { print It's not installed!; } Rob -Original Message- From: Dennis Senftleben [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19,

RE: variable interpolation

2002-04-19 Thread Hanson, Robert
I prefer using a placeholder, you don't need to quote anything that way which avoids mistakes. my $sth = $dbh-prepare('SELECT something FROM some_table WHERE some_key = ?'); $sth-execute( CGI-param('NAME') ); Did you also print out the variable to prove that it does indeed contain some data?

RE: why wont html templates work with perl ???

2002-04-10 Thread Hanson, Robert
It probably means that they don't have it installed. You can create your own library directory by putting the files in a directory and adding that directory to your library path (i.e. @INC). See the lib pragma docs on how to add a library path. http://www.perldoc.com/perl5.6.1/lib/lib.html Rob

RE: extra space

2002-04-10 Thread Hanson, Robert
I can't figure out what this is doing... my @sorted = map { $_-[2] } sort { $a-[0] = $b-[0] || $a-[1] = $b-[1] } map { [ (split /\t/)[3,2], $_ ] } @lines; Hmmm... let's see. @lines; 1. Iterate over @lines map { [ (split /\t/)[3,2], $_ ] } 2. For

RE: Search Replace Issue

2002-04-09 Thread Hanson, Robert
I'm sure that this can be done is less steps, but it works... #!/usr/bin/perl -w use strict; my $line = stuff\n; print chgSpace($line); sub chgSpace { my $line = shift; my ( $spaces ) = $line =~ /^(\s+)/; $spaces =~ s/ /_/g; $line =~ s/^\s+/$spaces/; return $line; }

RE: Perl 6?

2002-04-03 Thread Hanson, Robert
Here is the dev site. http://dev.perl.org/perl6/ The Apocalypses are written by Larry Wall and describe the way things will work in Perl 6, the Exegeses are written by Damian Conway where he gives examples of what Larry is taking about. The RFC's are proposed changes submitted by the Perl

RE: arithmetic operators

2002-03-25 Thread Hanson, Robert
Look at CGI.pm for grabbing form data... use CGI qw/:standard/; my $diff = param('val1') - param('val2'); Rob -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 9:20 AM To: [EMAIL PROTECTED] Subject: arithmetic operators in short, how

RE: How I can do logout?

2002-03-25 Thread Hanson, Robert
There's a lot more to it than that, there is no real concept of connected when you talk about Web apps and HTTP. In *general* a browser will connect to a web server, grab a single page (or image), then disconnect. When the user clicks a link it connects again, gets the one page, and disconnects

RE: Newbie reference question

2002-03-25 Thread Hanson, Robert
Is this the best way to make two dimentional arrays... ...and then I can reference it @{@y[$i]}[$j}; That is a little icky. You can access individual elements like this: $y[0]-[1] Or $y[0][1] I was wondering if I can construct the array without a variable x. I tried: push(@y, \f());

RE: Perl Modules

2002-03-19 Thread Hanson, Robert
You installed it wrong. First of all the module is Net::Telnet, so it needs to be in the Net/ subdirectory, like this... /usr/perl5/5.00503/sun4-solaris/Net Second, some modules (not all) need to be compiled or have some other things that need to be done during the installation. So if copying

RE: time calculation

2002-03-19 Thread Hanson, Robert
Like Timothy said, you didn't give enough info. Check out the perldoc for localtime first to see if that solves your problem, and if not please post a code example. You can get the localtime docs by either typing the following from the command like or navigating to the perlfunc manpage in your

RE: DBI really quick question

2002-03-19 Thread Hanson, Robert
How do I CREATE a database from within perl with MySQL? I don't think you can... but you can run the mysql interface from the script. Actually I think that you can pipe a list of commands to mysql. Rob -Original Message- From: James Taylor [mailto:[EMAIL PROTECTED]] Sent: Tuesday,

RE: LWP binary file retrievals?

2002-03-18 Thread Hanson, Robert
The problem might be that the getstore() expects character data, I'm not sure. What you can do is store it yourself, and force binary mode for the filehandle. #!/usr/gin/perl -w use strict; use LWP::Simple; # untested my $bin_data = get ('http://www.netcdf_url'); open OUT, ' filename';

RE: regular expressions in rindex function

2002-03-18 Thread Hanson, Robert
You can remove the whitespace at the end of a line with this regex... $text =~ s/\s+$//; It matches one or more whitespace chars at the end of the line and replaces them with nothing. Rob -Original Message- From: Richard Pfeiffer [mailto:[EMAIL PROTECTED]] Sent: Monday, March 18, 2002

RE: customising forms

2002-03-15 Thread Hanson, Robert
That all depends on if you want to do it server side or client side. I usually prefer the server side, in which case your Perl script would handle that. The easiest way is to use some sort of template module, I usually use HTML::Template.

RE: printf and archive questions

2002-03-15 Thread Hanson, Robert
I don't know of a searchable archive. To format the number you can either roll your own, grab the solution in the Perl Cookbook, or use Number::Format. http://search.cpan.org/search?mode=modulequery=Number%3A%3AFormat use Number::Format; my $commaNum = new Number::Format(-thousands_sep =

RE: How long can $_ be?

2002-03-12 Thread Hanson, Robert
There is no limit on the length of a scalar in Perl other than the amount of memory you have. It is possible that it is splitting the newline because you are using a multi-byte character set, or the global variable $/ (input record seperator) was changed in the script, or you are working with

RE: Regex Help

2002-03-12 Thread Hanson, Robert
Maybe something like this: @line = split /:/, $theLineOfData; @line = map { s/^'(.*)'$/$1/ } (@line); # removes the ticks And to match the whole word: if ( $field =~ /\bBRANCH\b/ ) { # matches word boundary } Or you could remove the whitespace as well to simply things... @line =

RE: Perldoc question

2002-03-12 Thread Hanson, Robert
perldoc isn't in your path most likely. Check your path environment variable (echo $PATH), and make sure that perldoc is in one of those directories. If I had to guess you probably have a symlink to the perl executable in your path, but not the actual bin/ directory of perl. Rob -Original

RE: session id

2002-03-12 Thread Hanson, Robert
I usually use Session::Apache for that. It will allow for the creation of session ID's, storing data, and retreival of data. You will need to set up a table in a database, and then put some code in each page to fetch the session ID from the querystring or cookie so that it can initialize the

RE: html in a cgi script

2002-03-11 Thread Hanson, Robert
Here is the short story... 1. All HTTP messages have a header and a body section. The header includes content type (HTML, text, GIF, etc), the length of the content, login info, etc, etc. The body contains the actual data. 2. The head and body sections are seperated by a blank line. 3. You

RE: html in a cgi script

2002-03-11 Thread Hanson, Robert
An example? Sure, here's one. #!/usr/bin/perl print Content-type: text/html\n\n; print htmlbodyHello World/body/html; That's all there is to it. Rob -Original Message- From: Matthew Harrison [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 12:31 PM To: Hanson, Robert; [EMAIL

RE: Assigning part of a string to a variable using the filehandle.

2002-03-11 Thread Hanson, Robert
I think you want something like this (or some derivation)... while (DATA) { if( /DisplayName(.*)/ ) { print $_; # print the full line $mytext = $1; # assign trapped text } } Rob -Original Message- From: Allison Ogle [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002

RE: Browser navigation with cgi

2002-03-11 Thread Hanson, Robert
You can't do that server side, you would need to use client side JavaScript in the page to do that. What it sounds like though it that you have a user filling in a form, and if there is a problem with it you want to send them to the form again, right? If so, what you want to do is show them

RE: Newbie Question

2002-03-11 Thread Hanson, Robert
Some versions of PPM had some problems, and your config file might have been messed up. I haven't seen this problem lately, but I have had it happen to myself a while ago. There should be a file called ppm.xml in your Perl library. You will need to check it out, and see if it is still a

RE: days calculation

2002-03-11 Thread Hanson, Robert
I only tested it real quick, but it seems ok. I would test it a little more though, and maybe add some error checking. use Time::Local; $var1 = '2002-02-01'; $var2 = '2002-02-28'; print daysDiff($var1, $var2); sub daysDiff { $d1 = dateToTime($_[0]); $d2 = dateToTime($_[1]); return

RE: days calculation

2002-03-11 Thread Hanson, Robert
Even easier is to use Date::Parse. use Date::Parse; $var1 = '2002-02-01'; $var2 = '2002-02-28'; print abs( str2time($var1) - str2time($var2) ) / 86400; Rob -Original Message- From: Imtiaz ahmad [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 4:19 PM To: '[EMAIL PROTECTED]'

RE: unusual character splitting

2002-03-06 Thread Hanson, Robert
perldoc perllocale has a lot of info and explains everything. It depends on a lot of things including your OS, and how it is setup. (at least that is what it says, I don't know enough about it to refute it) Rob -Original Message- From: Chris Ball [mailto:[EMAIL PROTECTED]] Sent:

RE: command line arguments

2002-03-06 Thread Hanson, Robert
You should be able to just escape the *. Single quoting them should also work. script.pl file\* names\* script.pl 'file*' 'names*' Rob -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:03 PM To: Beginners (E-mail) Subject: command

RE: command line arguments

2002-03-06 Thread Hanson, Robert
Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 5:08 PM To: Hanson, Robert; Nikola Janceski; Beginners (E-mail) Subject: RE: command line arguments I was hoping for some way to capture it in perl instead with out having to change the command line

RE: finding example scripts

2002-03-05 Thread Hanson, Robert
I think it is unlikely that you will find any samples on the web like this (but ya never know). Frankly though it sounds like a simple problem, maybe less than 10 lines of code depending on the complexity. You might want to look at the docs for File::Find and File::Copy to get some ideas.

RE: Simple question need ans

2002-03-04 Thread Hanson, Robert
As usual there are many ways to do it. I haven't done much with opening files for read and write at the same time, so someone else will have to provide ideas for that. I would either read in the whole file, then rewrite the whole file... or use DBI (assuming the file is CSV). If you read in

RE: appending to rows

2002-03-01 Thread Hanson, Robert
I would use the second approach. I would think that it would be better performance-wise, not to mention I always like to have a backup in case things don't work the way I expected. Alother thing you have to try to do is only read in as much data at one time as you need to, because a million

RE: Dereferencing a referenced hash.

2002-02-28 Thread Hanson, Robert
The trick is to use {$ref} where you would normally put the variable name: So $array[0] becomes ${$ref}[0] (not @$ref[0] which is a slice). And $hash{key} becomes ${ref}{key}. Or you can use the little arrow syntax... ${$ref}[0] is the same as $ref-[0]. And ${$ref}{key} is the same as

RE: Spaces in form values -- cgi

2002-02-15 Thread Hanson, Robert
Yeah, you will be fine with the spaces. The browser may(?) URL encode them before sending them to the server. So your value will look like this when it hits the server: kayak+touring+rescue+techniques Or maybe this, which is equivelent: kayak%20touring%20rescue%20techniques When you use

RE: Differences in DBM

2002-02-15 Thread Hanson, Robert
There is some info on the AnyDBM_File manpage. http://www.perldoc.com/perl5.6.1/lib/AnyDBM_File.html Rob -Original Message- From: Balint, Jess [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:05 PM To: '[EMAIL PROTECTED]' Subject: Differences in DBM Hello, I was wondering

RE: Checking Perl load

2002-02-15 Thread Hanson, Robert
You can check to see if its in your path by typing perl -v at the command line, otherwise just use the search finction, and search for perl.exe. Rob -Original Message- From: Ned Cunningham [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:19 PM To: '[EMAIL PROTECTED]'

RE: Getting the proper info from an INI file...

2002-02-15 Thread Hanson, Robert
My preference is Config::IniFiles. You can see others by searching on CPAN. http://search.cpan.org/doc/WADG/Config-IniFiles-2.27/IniFiles.pm You also can't load files from CPAN using PPM. PPM loads from the ActiveState repositiory only! If you want to use CPAN modules you need to find

RE: Checking Perl load

2002-02-15 Thread Hanson, Robert
Then how about dir /s perl.exe? Rob -Original Message- From: Ned Cunningham [mailto:[EMAIL PROTECTED]] Sent: Friday, February 15, 2002 2:25 PM To: Hanson, Robert; Ned Cunningham; '[EMAIL PROTECTED]' Subject: RE: Checking Perl load Yes, except I load the path separately, so

RE: removing white space

2002-02-14 Thread Hanson, Robert
The first is more efficient, the second is less typing. And actually the second one is incorrect, it should be this: Rob -Original Message- From: David Gilden [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: removing white space

RE: removing white space

2002-02-14 Thread Hanson, Robert
: Hanson, Robert Sent: Thursday, February 14, 2002 12:36 PM To: 'David Gilden'; [EMAIL PROTECTED] Subject: RE: removing white space The first is more efficient, the second is less typing. And actually the second one is incorrect, it should be this: Rob -Original Message- From: David

RE: buton names

2002-02-13 Thread Hanson, Robert
You can do it just like that. Given this HTML form: form action=/cgi-bin/test.cgi input type=submit name=button1 value=This is button 1 input type=submit name=button2 value=This is button 2 /form You can use this script: #!/usr/bin/perl use CGI qw/:standard/; print header(); if (

RE: buton names

2002-02-13 Thread Hanson, Robert
, but stuff happens). Rob -Original Message- From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 4:56 PM To: Hanson, Robert; 'GsuLinuX'; [EMAIL PROTECTED] Subject: RE: buton names I understood his request differently, that he wanted to send the parameters

Learning Perl Question

2002-02-13 Thread Hanson, Robert
[Sorry if this isn't the place to post this, but I thought it might be interesting. Flaming will be accepted] I'm teaching a Perl class from the Learning Perl book, and noticed an inconsistency with the way certain constructs work. In chapter 2 it mentions a rule in Perl: any time that you

RE: Syntax of Messages

2002-02-12 Thread Hanson, Robert
$_ is the default scalar variable (sort of). Perl will sometimes set this variable for you so that you don't need to create your own. It's just a shortcut of sorts. Here is an example... foreach ( @list ) { print $_; } For each item in the array @list Perl will set the variable $_

RE: Time conversion question

2002-02-12 Thread Hanson, Robert
My favorite way is to use Date::Parse (http://search.cpan.org/doc/GBARR/TimeDate-1.10/lib/Date/Parse.pm) use Date::Parse; my $epoch = str2time(02/05/2002 02:31:14); It comes with the Time-Date bundle (http://search.cpan.org/search?dist=TimeDate) which also includes the method time2str() for

RE: Password Generator

2002-02-08 Thread Hanson, Robert
To do what? Just generate random passwords? How about this. my @c = (a..z,A..Z,0..9,qw|! @ # $ % ^ * ( ) [ ]|); for (1..8) { print $c[int(rand(@c) + 1)]; } Rob -Original Message- From: Mike [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 4:47 PM To: [EMAIL PROTECTED]

RE: multiple quotes

2002-02-07 Thread Hanson, Robert
Two different ways. Use the qq operator or escape the quotes. print qq[pimg border=0 src=BD08906_.gif width=190 height=156\n]; print pimg border=\0\ src=\BD08906_.gif\ width=\190\ height=156\n; Rob -Original Message- From: Mike Smith [mailto:[EMAIL PROTECTED]] Sent: Thursday, February

RE: printing an email address

2002-02-06 Thread Hanson, Robert
It looks like that is the answer though, in a roundabout way. Teddy, if this is for output into an HTML page, no, it won't show up because and are special chars. You need to HTML encode them, manually or otherwise. This should work: $line = lt;orasnita\@yahoo.comgt;; print $line; Rob

RE: Text block switching or HTML Templating

2002-02-06 Thread Hanson, Robert
I always prefer using templates (actually HTML::Template like Scot mentioned), but it won't make you pages dynamic, each page would need to be accessed through a script. You could though use HTML::Template to create templates on your dev server (which would be your own PC, and then write a

RE: Execute perl Script

2002-02-06 Thread Hanson, Robert
It depends on exacly what you are trying to do. do executes a script. `perl foo.pl` runs the script and returns the output. system runs the script, no output returned. eval runs a piece of code (usually for dynamic code). Rob -Original Message- From: Mike [mailto:[EMAIL PROTECTED]]

RE: passing parameters

2002-02-05 Thread Hanson, Robert
This works fine for me... #!/usr/bin/perl use CGI; $query = new CGI; @values = $query-param('name'); print Content-type: text/plain\n\n; print @values; Rob -Original Message- From: Rahul Garg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 9:45 AM To: [EMAIL PROTECTED]

RE: Hexadecimal Dictionary

2002-02-05 Thread Hanson, Robert
I wrote this routine to do the conversion for me. When you run it at the command line is takes a string as input, and prints out the hex val of each char in the string. #!/usr/bin/perl # c2hex.pl - Converts characters to hex values. my $chars = join(' ',@ARGV); for ( split(//, $chars) ) {

RE: Perl and CGI

2002-02-05 Thread Hanson, Robert
According to www.pcwebopaedia.com, a CGI program is defined as: A CGI program is any program designed to accept and return data that conforms to the CGI specification In short Perl is a language and CGI is not. CGI is an interface that allows you to transfer information between a CGI program

RE: Perl and CGI

2002-02-05 Thread Hanson, Robert
Here is a tutorial that will help you get started writing CGI scripts in Perl... if that was your goal. http://www.webdesigns1.com/perl/tutorial.html Rob -Original Message- From: Naveen Parmar [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 05, 2002 5:31 PM To: [EMAIL PROTECTED]

RE: Using =~ with a list

2002-02-04 Thread Hanson, Robert
You probably want to use map. This should work. @body = map { s/foo/bar/; $_ } (@body); Rob -Original Message- From: Lysander [mailto:[EMAIL PROTECTED]] Sent: Monday, February 04, 2002 1:17 PM To: [EMAIL PROTECTED] Subject: Using =~ with a list I need to replace all the occurances

RE: Using =~ with a list

2002-02-04 Thread Hanson, Robert
Ahhh, I see. So this would work as well. map {s/foo/bar/} @data; But the for seems to be a little bit faster which makes sense. Benchmark: timing 100 iterations of FOR, MAP... FOR: 16 wallclock secs (15.84 usr + 0.00 sys = 15.84 CPU) @ 63119.36/s (n=100) MAP: 19 wallclock secs

RE: cache

2002-02-01 Thread Hanson, Robert
I believe nocache is for Netscape only. For IE you should use expires. (or was it the other way around) ...So you should use both. I don't have any references handy, but a value of 0 for expires might work. Alternatively you could use a scheme that a lot of ad agencies use. They append a

RE: PERL and XML Parser

2002-02-01 Thread Hanson, Robert
There are tons of XML modules, many of which make that sort of thing easy... but it depends on exactly what you want to do. Here are some snippets: use XML::EasyOBJ; my $obj = new XML::EasyOBJ('killme.xml'); foreach ( $obj-albums ) { print $_-owner-getString . \n; } -- OR -- use

RE: change all files in directory

2002-02-01 Thread Hanson, Robert
Yeah, here is an easy solution, run it right at the command line... (Make a backup of the files first!!) perl -pi -e 's|satellite|target|' *.cpp *.hpp *.asc perl -pi -e 's|Satellite|Target|' *.cpp *.hpp *.asc perl -pi -e 's|SATELLITE|TARGET|' *.cpp *.hpp *.asc Rob -Original Message-

RE: change all files in directory

2002-02-01 Thread Hanson, Robert
From: Jenda Krynicky [mailto:[EMAIL PROTECTED]] If you keep your code do not forget to add the /g option Oops! perl -pi -e 's|satellite|target|g' *.cpp *.hpp *.asc perl -pi -e 's|Satellite|Target|g' *.cpp *.hpp *.asc perl -pi -e 's|SATELLITE|TARGET|g' *.cpp *.hpp *.asc Rob -- To

  1   2   >