Re: Perl/DBI

2007-06-24 Thread Paul Archer
> If you are not interested in using the modules, it is not actually that hard > to roll your own. In the past I have done different things for total > counts, either two separate queries, one just a 'SELECT COUNT(*)' and the > other to actually fetch the data. Depending on your data you might b

Re: Help on reading esc sequence

2007-06-11 Thread Paul Archer
The reason this works is that when you read from STDIN, you are getting the newline from when the user of the program hits return. Using '=~' is implying a 'match', which will match the string/regexp supplied within the variable's value. 'eq' means the two strings have to be exactly equal to ea

Re: Adding a comma to format localtime

2007-04-12 Thread Paul Archer
A cleaner way to do it is: printf "%s, %s %s %s %s\n", (split ' ', localtime)[0,2,1,4,3]; Or, if you want to save it to a variable: my $dateout = sprintf "%s, %s %s %s %s\n", (split ' ', localtime)[0,2,1,4,3]; Paul 11:57am, Susheel Koushik wrote: use this: $str = localtime; @fields = split/

Re: figuring out if a number/character string is null in Perl

2006-09-01 Thread Paul Archer
Derek, it was nice of you to include your title and all. That way when a future (potential) employer Googles you, they'll know for sure that it was you that was this childish and immature. 8:13am, Derek Ash wrote: Perl Sucks! Derek Ash Application Programmer II University of Illinois Colleg

Re: Insecure $ENV{PATH}

2006-06-08 Thread Paul Archer
From 'perldoc -q taint' Found in /usr/lib/perl5/5.8.8/pod/perlfaq7.pod How can I tell if a variable is tainted? You can use the tainted() function of the Scalar::Util module, available from CPAN (or included with Perl since release 5.8.0). See also "Laundering and Detectin

Re: need help

2006-03-22 Thread Paul Archer
Yesterday, Chris Devers wrote: On Tue, 21 Mar 2006, julian thomas p wrote: but when i tried to run inweb server(biosolutions.siteburg.com) iam getting a blank page rather than results. permission level for script is 711 and for cgi folder 700. Can [you] please post some code? Can you writ

Re: Problems opening files from CGI.pm program in Windows

2006-01-22 Thread Paul Archer
3:43pm, Mary Anderson wrote: Hi All, I am running Perl 5.8.7 (ActivePerl) on a Windows XP platform. I have been unable to open files from a CGI.pm script. Here is the offending code: use CGI qw/:standard :html3 :netscape/; use POSIX 'strftime'; use CGI::Carp('carpout'); open(LOG,">>.\gue

Re: File Modification Date

2005-09-14 Thread Paul Archer
perldoc -q timestamp 12:42am, Vance M. Allen wrote: I'm trying to find out how to determine the date and/or time that a file was created in a simple procedure. I have heard about a few different libraries but the examples I have found haven't been very useful. The basic purpose I want to do

RE: Force a file download for link

2005-08-30 Thread Paul Archer
You might want to look at how sourceforge.net handles things when you go to download. I don't know the mechanism, but it's the behavior you want. Paul 3:23pm, Denzil Kruse wrote: --- Bob Showalter <[EMAIL PROTECTED]> wrote: use CGI qw(:standard); open FILE, ...blah blah... pri

Re: Sort hash on key value

2005-05-07 Thread Paul Archer
No problem. Glad to help, especially since you did the right thing (tried something, tried to work it out, and posted your code when you couldn't). 8:24pm, Mike Blezien wrote: Ah! ... had is ass-backwards, I though it didn't look right. Thank you for your help...much appreciated :) P

Re: Sort hash on key value

2005-05-07 Thread Paul Archer
7:22pm, Mike Blezien wrote: Hello, I've gone through serveral posting regarding sorting hashes, but can't seem to get it to sort correctly. I need it to sort on the key value and not the key it reads from a file like this: 1::sometext_here 2::sometext_here2 3::sometext_here3 And reads the data l

Re: cgi scripts as root or similar - best method

2005-02-25 Thread Paul Archer
Are you sure that cdrecord needs to run as root? You might check into changin permissions on the device itself. Or if this is a trusted machine/environment (I assume it is, 'cause most people don't write web apps to burn CDs), then you could suid cdrecord itself as root. Be sure you understand

Re: printing output of a command

2005-02-21 Thread Paul Archer
I'm not saying you have to become root. I'm simply saying that for some people it's a temptation ("If I change this to root, I don't have to worry about ownership problems ever again"). 6:21pm, Vladimir D Belousov wrote: Why root? Just the user who has permission

Re: printing output of a command

2005-02-21 Thread Paul Archer
group you specify. Paul Archer wrote: This is a very common problem. When you run the script from the command line, you are running it with different privileges and a different path than when the web server runs it. Most likely, either the command is not in the path for CGI scripts (try setting

Re: printing output of a command

2005-02-20 Thread Paul Archer
This is a very common problem. When you run the script from the command line, you are running it with different privileges and a different path than when the web server runs it. Most likely, either the command is not in the path for CGI scripts (try setting $ENV{PATH} or calling the command with

Re: Module confusion

2005-02-07 Thread Paul Archer
Keep in mind two things: 1) you may need to build the module locally on a similar box (linux, same basic version of Perl), and 2) since the module is Time::HiRes, there needs to be a Time directory in your modules directory, and the HiRes.pm file need to be in that directory. EG: ~bobmin/perlmod

Re: Perl out to PHP

2005-02-04 Thread Paul Archer
8:20am, Gary Stainburn wrote: On Thursday 03 February 2005 6:50 pm, Paul Archer wrote: 4:19pm, Ing. Branislav Gerzo wrote: Hi all, My friend is making website in PHP, but my scripts are in Perl, for example user write some text, and I want for example print it uppercase (I know, bad example, but I

Re: Perl out to PHP

2005-02-03 Thread Paul Archer
4:19pm, Ing. Branislav Gerzo wrote: Hi all, My friend is making website in PHP, but my scripts are in Perl, for example user write some text, and I want for example print it uppercase (I know, bad example, but I want/have to do it - something different and more complex - in my case via Perl). So I'

Re: embedding dynamic images in html output

2005-01-24 Thread Paul Archer
1:49pm, Chad Gard wrote: Thanks for tips/pointers, all. I was unable to make the graphs consistently small enough to use the data url scheme that David pointed me toward. For now, I opted for passing enough off to another script to make another database request. It's causes several redundant S

Re: embedding dynamic images in html output

2005-01-21 Thread Paul Archer
11:03am, Chad Gard wrote: On Jan 21, 2005, at 10:22 AM, Sean Davis wrote: You could also have your main script generate the images all at once (at the same time as you are generating the HTML), put the graphics in temp files, and then put the appropriate URLs in the img tags. This will eliminat

Re: Insecure dependency in glob while running with -T switch

2005-01-17 Thread Paul Archer
I just tried that on the command-line, and I'm not getting the warning you're seeing. What version of Perl are you running? And have you tried alternatives like my @files = `ls`; or using opendir/readdir? Paul Yesterday, David Gilden wrote: Last question here, #!/usr/bin/perl -wT Snip ..

Re: bind values and cgi params

2005-01-06 Thread Paul Archer
2:48pm, Robert wrote: I have a form that is submitting and the url ending is "?position=BSIPL". My form has "method="get"" in it. I have tried it without a method as well. I have in my CGI: my $pid = $q->param('position'); # which should now hold BSIPL right? My SQL is as so: my $sth = $dbh->prepa

Re: How to avoid accidental re-sending of POST data

2004-12-01 Thread Paul Archer
I'm no CGI expert, but my best guess is that you are not going to be able to stop the user from resending the data, so you are going to have to make sure you ignore the resent data. I would do this by generating a random number in a hidden input field when creating the form. Then you can check that

Re: Sorting a hash

2004-09-28 Thread Paul Archer
problem on your own. If you can't, then write to the *appropriate* forum (as someone else mentioned, this has nothing to do with CGI, so you should have posted to a different list). And when you write, post not only the prob

Re: CGI and mySQL book, any recommendation.

2004-05-30 Thread Paul Archer
r position (MySQL is a wannabe and nearly end-of-life). While I am not refuting your claims, I would appreciate a little evidence in support of these claims so that I can better judge for myself. Thanks, Paul Archer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: Network Traffic Monitoring

2004-05-17 Thread Paul Archer
This has zip to do with Perl or CGI. If you're going to post off-topic, at least have the courtesy to say "Hey, this is off-topic, but I haven't been able to find the answer anywhere else..." That said, try ntop (www.ntop.org). Paul Archer 1:56pm, Werner Otto wrote: > Hi

Re: Post Method

2004-05-14 Thread Paul Archer
1:08pm, Werner wrote: > Hi There, > > I've got a html page that uses the following: > > enctype="multipart/form-data"> > > and would like to change the "GET" method to the "POST" method. > > my current people.cgi looks like: > > $temp=$ENV{'QUERY_STRING'}; > #read(STDIN,$temp,$ENV{'CONTENT_LENGTH

Re: bad type of variable?

2004-05-14 Thread Paul Archer
3:03pm, Aben Siatris wrote: > > : my $number=(0.75-0.54)/0.03; > > : print "$number\n"; > > : for (0..$number) > > : { > > : print "$_ / $number\n"; > > : } > > : > > : my $number=(75-54)/3; > > : print "$number\n"; > > : for (0..$number) > > : { > > : print "$_ / $number\n"; > > : } > > : > > :

Re: Not reading the whole file

2004-05-04 Thread Paul Archer
3:01pm, Richard Heintze wrote: > This code is not reading the entire file. It is my > intent that it read the entire file. Can somone help > me remedy this problem? > > Thanks, >Siegfried > > open (INFILE, "data.txt"); Are you sure your file opened properly? Did you check? open (INFIL

Re: Form mailer and environment variables

2004-04-30 Thread Paul Archer
Tomorrow, Jan Eden wrote: > Hi all, > > I wrote a little form mail script and start by setting the environment variables > like this: > > BEGIN { > $ENV{PATH} = "/usr/sbin"; > delete @ENV{ qw( IFS CDPATH ENV BASH_ENV) }; > } > Why are you deleting these variables? > Now the actual direc

Re: Sending a parameter to a subroutine

2004-04-13 Thread Paul Archer
> I've created a subrutine to acces DB, but while sending the Query it get an > error. > > My function looks like: > > sub DbSqlQuery >{ >local $str_query = @_ if @_; (Why are you using local? 'local' is deprecated in favor of 'my'.) $str_query is a scalar, @_ is an array. Putting a scala

Re: next if statement....

2004-03-18 Thread Paul Archer
12:15pm, Greg Schiedler wrote: > OK I'm trying to modify the code below to recognize an additional next if statement. > I have > included a snip of the file that the code uses an input. > > Greg > > next if /Acct-Session-Id = ""/;This statment works! > A 'next if /./' is a short

Re: changing system password

2004-03-17 Thread Paul Archer
My guess is that since you're running sudo, sudo itself is asking for a password *for the nobody/apache account*, where it's set up not to ask you for a password (which is bad mojo), or you already ran sudo once and you've got a valid ticket. Paul Archer 11:38am, Andrew Gaffne