Re: Function & Parameters Problem

2001-09-12 Thread Stephen P. Potter
', | -textvariable=>\$y, | -width=>$lw, | -anchor=>'w', | -bg=>'white')->pack(-anchor=>'w'); | | } The parameters are passed in the special

Re: Unable to open a File -- ANY HELP PLS.

2001-09-07 Thread Stephen P. Potter
ooking at permissions and paths. Often in CGI scripts the path to the file is not what is expected. -spp -- Stephen P PotterColumbus, Ohio, USA [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a poi

Re: Newbie Run time issue

2001-09-07 Thread Stephen P. Potter
as running it through your web server, you'll need to provide more information. Check your log files to see what error it is reporting. Are you sure that /ecommerce/webpages/cgi-bin is actually set up to be the proper location for CGI execution? -spp -- Stephen P PotterColumbus, Ohio,

Re: foreach and the ordering of array's

2001-09-07 Thread Stephen P. Potter
ooking for. This holds for any list context where an array | is used, not just for/foreach (e.g. print(), join(), map(), etc.) No, you want to supply a list to foreach, not an array. If you rewrite the above using a list for most everywhere you say array, you see how much simpler it

Re: LWP Module installation on SGI/IRIX

2001-09-07 Thread Stephen P. Potter
ething like: perl -M[name] -e 'print $[name]::VERSION' for example: $ perl -MCPAN -e 'print $CPAN::VERSION' 1.52 $ or, even more simply perl -M[name] -e '' for example: $ perl -MCPAN -e '' $ $ perl -Mfake -e '' Can't locate fake.pm in @

Re: foreach and the ordering of array's

2001-09-07 Thread Stephen P. Potter
g is not true. There is no way to have foreach tell you what element you are on, although it is possible to find it out indirectly. It will, however, always walk the array by going from memory location to memory location, so it will always traverse it in the same order. -spp -- Stephen P Potter

Re: foreach and the ordering of array's

2001-09-07 Thread Stephen P. Potter
ays be ordered by subscript. With % it will always be in the hash order, you just may not be able to guess what the hash order is. -spp -- Stephen P PotterColumbus, Ohio, USA [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. O

Re: Displaying the output of a system command in HTML

2001-08-28 Thread Stephen P. Potter
e is output, you'll probably see it on STDOUT (your screen). The backticks do much the same as system() except that the output of the command is what is returned. So, try: $command = 'pgp -kv'; $output = `$command`; print "The output is: \n"; print $output; -spp -- Stephen P

Re: Installing Module

2001-08-28 Thread Stephen P. Potter
make test make install Sometimes there might be pre-requisite modules that you'll also have to get and install. Repeat this procedure until you get everything. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke

Re: Re[6]: Stripping line breaks

2001-08-28 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Jeff 'japhy/Marillion' Pinyan whispered: | On Aug 28, Stephen P. Potter said: | | >Lightning flashed, thunder crashed and Maxim Berlin <[EMAIL PROTECTED]> whispere > d: | >| | >| well, ${ unassigned now... | >| |

Re: Re[6]: Stripping line breaks

2001-08-28 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Maxim Berlin <[EMAIL PROTECTED]> whispered: | | well, ${ unassigned now... | And must remain unassigned, otherwise there is no way to disambiguate: print "$dayday" and print "${day}day" -spp -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional c

Re: Removing Leading Zeros

2001-08-17 Thread Stephen P. Potter
did you come up with the offsets? Are you guaranteed that $index and $value will only have digits in them? If so, $index+0 will conver the string "000234" into the digit 234. Or, if you want, you can use /^0+/ to remove the leading zeros. -spp -- Stephen P Potter

Re: cannot fix an error - "Bus error (core dumped) "

2001-07-31 Thread Stephen P. Potter
n't have to modify the array inside the loop. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon Cozens UNIX, Perl, PHP, Web C

Re: substitution

2001-07-31 Thread Stephen P. Potter
e file printing all the lines after they've been worked with (-pe). If a line starts with , the will be removed. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that

Re: String replace in a file

2001-07-30 Thread Stephen P. Potter
of the original file and a new file with the changes. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon Cozens UNIX, Perl, P

Re: counting files of a directory

2001-07-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sascha Kersken" <[EMAIL PROTECTED]> w hispered: | DIR = opendir ("path/to/dir"); I think you mean 'opendir(DIR, "/path/to/dir");' not 'DIR = opendir("/path/to/dir");'. -spp -- Stephen

Re: sending mail (learning perl program)

2001-07-30 Thread Stephen P. Potter
fails (if it isn't in /usr/sbin, for example). This is not true though. Only by checking the status of the close will you be able to determine this. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect th

Re: setting and importing ENV from within PERL

2001-07-27 Thread Stephen P. Potter
really is no way to make a child affect its parent. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon Cozens UNIX, Perl, PHP, We

Re: checking for true/false after a command has run

2001-07-26 Thread Stephen P. Potter
FOO, "foo" or die "Blah: $!\n": open(FOO, "foo") || die "Blah: $!\n"; A lot of old timers (and/or C programmers) use the second form. 'or' is an addition to perl 5 that earlier perl's didn't have, and that C doesn't have. So, it

Re: appending to file?

2001-07-26 Thread Stephen P. Potter
nates, the close() will happen automatically. | open(APPEND,">>testfile") || die print "Can't open testfile: $!\n"; What is "die print"? You only need one of them. -spp -- Stephen P Potter [EMAIL PROTECTED] "You c

Re: Date problem

2001-07-26 Thread Stephen P. Potter
igits (the last two are the year), you can do something like: $date = "010201"; substr($date, -2, 0, '20'); print $date; This will print "01022001". What it is doing is replacing zero characters at the -2 offset (2 from the end) of

Re: stat() keeps returningthe incorrect date

2001-07-26 Thread Stephen P. Potter
ir(DIR, "/etc") do a chdir("/etc"), then opendir(DIR, ".") to make sure that everything is working on the same current directory. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke La

Re: STDIN

2001-07-26 Thread Stephen P. Potter
.. as equal to the first." What does this script do for you: $first = ; $second = ; $third = ; print "First: $first"; print "Second: $second": print "Third: $third"; If I feed it "first", "second",

Re: Running Perl scripts...

2001-07-26 Thread Stephen P. Potter
m the command line, it will have your userid and your privledges. When it is run from the web server, it will have the web server's userid and privledges (which is usually different from your own). -spp -- Stephen P Potter [EMAIL PROTECTED] "Y

Re: Unix syntax

2001-07-26 Thread Stephen P. Potter
to start with, your code should look something like this: usr lib '/home/luvz99/lib/perl'; use LWP::Simple; $doc = get ($url); Also, since LWP::Simple is part of the standard distribution, there shouldn't really be any reason to have the use lib anyway. -spp -- Stephen P Potter

Re: Removing spaces

2001-07-19 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Dave Neill <[EMAIL PROTECTED]> whispered: | There's also: | | $foo =~ s/^\s*//; You should always use /^\s+/. There's no sense in removing nothing if nothing is there. -spp -- Stephen P Potter

Re: Assigning a string value to a scalar

2001-07-18 Thread Stephen P. Potter
o see more code to be able to really tell you what is happening at this point. -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon

Re: Really really new

2001-07-18 Thread Stephen P. Potter
dynamically: @a = qw/116 44 45 49 71/; @b = qw/1 1 3 5 1/; printf "%3d" x @a, @a; print "\n"; printf "%3d" x @b, @b; print "\n"; -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry a

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
iters: if ($url =~ m|http://|i) -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon Cozens UNIX, Perl, PHP, Web Consulting and Tr

Re: if then and perl

2001-07-18 Thread Stephen P. Potter
| ; I'm not sure where your confusion came from, but this is some kind of wierd incest between shell and perl. You want to do some kind of string comparison, such as: if ($url eq "HTTP://";) { or if ($url =~ /http:/i) { Your code should resemble this: if ($url =~ /h

Re: Hi, what time() ^ $$ means?

2001-07-12 Thread Stephen P. Potter
" by Robert Sebesta (ISBN 0139279555). It's nice and small and easy to get into. I'm waiting to see a copy of "Learning Perl, 3rd edition" (Randal, HINT!). I was disappointed with the second edition (I'll keep to myself how I think it happened), but hold great hope

Re: regexp and reading lines

2001-07-11 Thread Stephen P. Potter
this would work for you: while () { if (/heading/) { $variable = ; } } -spp -- Stephen P Potter [EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."

Re: Regrex - ignoring the boundaries

2001-07-11 Thread Stephen P. Potter
an up after yourself. Line 8 checks to see if $text contains the two delimiters we're looking for. Note the /s at the end to treat the string as a single line, ignoring the newline characters during the match. Also note that we save the formatted info

Re: I need to "touch" a binary file

2001-07-11 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Bob Bondi" <[EMAIL PROTECTED]> w hispered: | So, simple on Unix/Linux! Are there any solutions via Perl to "touch" a | binary file? Unix doesn't differentiate between different types of files. They are all just files. Perl is the same way. Do you want to

Re: problem when I sh Configure to setup perl 5.00503.

2001-07-11 Thread Stephen P. Potter
ind you have problems with 5.6.1, then send us some more information about your particular system (OS, version, etc). It is difficult to tell what might be the problem based solely on what you've provided so far. -spp -- Stephen P Potter[EMAIL PROTE

Re: Hi, what time() ^ $$ means?

2001-07-11 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Erik W <[EMAIL PROTECTED]> whispered: | Thanks a lot, then what << means? | $$<<15 ??? It seems to me that you need to spend some time with a good beginners book, such as Randal's. Or, at least, the man pages. These questions are easily answered with a qui

Re: Help: Searching an array question++

2001-07-10 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Bob Bondi" <[EMAIL PROTECTED]> w hispered: | Yep, another newbie at Perl. I have come to a wall. What I need to do is | open a file, find a value in the file and substitute a value. | I've gotten to the point of what to do with an open file. I have been tryi

Re: Hi, what time() ^ $$ means?

2001-07-10 Thread Stephen P. Potter
o numbers of roughly the same magnitude. -spp -- Stephen P Potter[EMAIL PROTECTED] "You can't just magically invoke Larry and expect that to prove your point. Or prove that you have a point."-Simon Cozens http://www.unixlabs.net/~spp/

Re: thank you

2001-05-31 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nichole Bialczyk <[EMAIL PROTECTED]> whispered : | i just wanted to let everyone know that i appreciate all of the time that | you spent on me (especially today). my log script runs absolutely | beautifully and my boss loves me! what else could i ask for?

Re: writing to a text file ... sorry

2001-05-31 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Nichole Bialczyk <[EMAIL PROTECTED]> whispered : | i'm sorry. i didn't think that you guys would want me to include my code. | i just assumed that i should try to make my question to the point with as | little text as possible. i am still having the same pr

Re: writing to a text file

2001-05-31 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Nichole Bialczyk" <[EMAIL PROTECTED]> whisper ed: | if(! open(LOG, ">xxx.txt)) { I really hate to pick on you, but if you are going to provide sample code, please make sure you are providing exactly what is in the script (cut'n'paste as opposed to retyping)

Re: Perl script not running

2001-05-31 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "King, Jason" <[EMAIL PROTECTED] com> whispered: | there are a number of HTML examples included with Perl | | perl/eg/IEExamples client-side PerlScript examples | perl/eg/aspSamples server-side Perl/ASP examples | perl/eg/Core/cgi server-

Re: regexp Help

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Kyrytow, Stefan" <[EMAIL PROTECTED] m> whispered: | Example. | I am writing a script to parse a web log and report on all the hosts in the | log. | However I have a command line option to exclude a domain from the report. | My problem is that I can't figure

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Peter Cornelius whispered: | > Use: | > | > if (@ARGV and -T $ARGV[0]) { ... } | | Just wondering if there is a reason for using the lower precedence 'and' | here instead of '&&'? I haven't been finding many uses for 'and' which | tells me I might not f

Re: How to install DBI

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "prasoeu" <[EMAIL PROTECTED]> whispe red: | Hi, | Somebody please tell me how to install perl DBI or mysql DBI, I have = | download the modules. Have you tried reading the README or INSTALL files? Generally, most modules are fairly well behaved and "perl M

Re: Binary and ASCII

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Cameron Malchow <[EMAIL PROTECTED]> whis pered: | In unix, specifically OS X, if you have a perl program that is either binar= | y | or ascii how can you convert it to the opposite format? Perl scripts are only in ASCII. It is possible, although it doesn't

Re: Problem with NET::PING

2001-05-30 Thread Stephen P. Potter
Lightning flashed, thunder crashed and VeeraRaju_Mareddi <[EMAIL PROTECTED]> whispered: | Dear All | I have a small with NET::PING.I hope its working by following command. | USE NET::PING; | But I am Not able to check remote connectivity of a host ("HOTNT002") | through this NET function...I am

Re: Installing perl modules under Solaris

2001-05-25 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Rivera Alonso, David" whispered: | I hope you won't hate me for this: | | after installing all the ".h" files under /usr/include, it goes much better, | but I still have strange warning: when I say "make" it gives an error: | | "gcc: installation problem,

Re: reg ftp

2001-05-25 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "baby lakshmi" <[EMAIL PROTECTED] > whispered: | hi | while doing ftp from windows to unix, the file contains ctl M at the end of | each line. my file is a huge data file. i am not able to delete that. is | there any better way to delete it. | If anyone can

Re: handling flat-file layouts -- pack or sprintf or something else?

2001-05-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and chris brown <[EMAIL PROTECTED]> whispered: | I would prefer to write each record using pack, but I | can't see how to elegantly get pack to zero-fill | without using sprintf. And I kind of feel like once | I'm using sprintf I might as well ONLY use sprintf f

Re: problem with a tutorial

2001-05-24 Thread Stephen P. Potter
Exactly what is the problem that you seem to be having? This is a CGI script that needs to be run from a web server. Do you have a web server that you have cgi-bin access to? What doesn't work for you? This worked just fine for me. -spp Lightning flashed, thunder crashed and Nichole Bialczyk

Re: ip addresses and getting them in perl

2001-05-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Brett W. McCoy" <[EMAIL PROTECTED]> whispered: | On Thu, 24 May 2001, David Matthew Monarres wrote: | It's part of a standard Perl installation. Type 'perldoc gethostbyname' perldoc -f gethostbyname will work better, since you are looking for a function i

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

2001-05-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Peter Cornelius whispered: | The camel book suggests the following: | | #!/bin/sh -- | eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' | if 0; | | Is this the best alternative and are there situations in which it might not | work? The camel suggests this for

Re: Installing perl modules under Solaris

2001-05-24 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Rivera Alonso, David" whispered: | I understand that it's searching for all those "*.h" mentioned in "perl.h". | But, where should they be? I've installed gcc compiler, shouldn't it contain | these files already? do I have to install C libraries or sthg? Y

Re: Strange chop behaviour

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Craig Moynes/Markham/IBM" <[EMAIL PROTECTED] bm.com> whispered: | open ( ERR, "; You are mixing things here you don't want to mix. This should just be: while ($in = ) { You *can* mix these, but there is no real reason to. Especially not in your sample c

Re: writing an array to file

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Kaustav Bhattacharya" whispered: | open(BOOT_FILES,">boot_files.txt"); | print BOOT_FILES @FILES; | close BOOT_FILES; You should always check the return of open and close... open BOOT_FILES, ">boot_files.txt" or die "Can't open boot_file

Re: Strange chop behaviour

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Collin Rogowski" <[EMAIL PROTECTED]> w hispered: | They exist both. | chop removes the last character. | chomp removes the last character if it's newline. Let's get this straight and correct. chomp removes the input record separator ($/). This may or may

Re: IF statements

2001-05-01 Thread Stephen P. Potter
There isn't a switch statement either. There's a way to make something that looks similar to a switch, but it isn't a builtin control structure. -spp Lightning flashed, thunder crashed and "Kaustav Bhattacharya" whispered: | Mark, | I only recently started coding in PERL so don't take the foll

Re: IF statements

2001-05-01 Thread Stephen P. Potter
Lightning flashed, thunder crashed and Mark Martin <[EMAIL PROTECTED]> whisper ed: | What I have is this: | | if ($variable == 02){ | print OUT1 "$variable"; | $lines1 ++; | } elsif($variable == 03){ | print OUT1 "$variable\n"; | $lines2 ++; | } elsif($variable == "08"){

Re: missing something obvious

2001-04-25 Thread Stephen P. Potter
Lightning flashed, thunder crashed and "Sean O'Leary" <[EMAIL PROTECTED]> whisp ered: | split (/./, $ARGV[0], 5) | | I don't know what the 5 is doing there ( I think it should be a 4, because | you are assigning the result of the split to 4 a list of variables, but the | compiler knows about ma