Re: Help with sprintf

2005-09-12 Thread John W. Krahn
Kevin Old wrote: > Hello everyone, Hello, > I'm having trouble with sprintf. I know it's some silly mistake I'm > making, but can't seem to figure it out. > > Here's what I have: > > my @time = localtime(); > $time[4]++; > $time[5] += 1900; > my $lastmonday = sprintf("%02d", $time[5]) . sprint

Re: Help with sprintf

2005-09-12 Thread Octavian Rasnita
- Original Message - Hello everyone, I'm having trouble with sprintf. I know it's some silly mistake I'm making, but can't seem to figure it out. Here's what I have: my @time = localtime(); $time[4]++; $time[5] += 1900; my $lastmonday = sprintf("%02d", $time[5]) . sprintf("%02d", $tim

Re: Help with sprintf

2005-09-12 Thread Wijaya Edward
- Original Message - From: Kevin Old <[EMAIL PROTECTED]> Date: Tuesday, September 13, 2005 5:31 am Subject: Help with sprintf > Hello everyone, Hello, > My result is: 20050901, but what I'm trying to get is 050901. > You can try with two possibilities: 1. Using Mod 100 on the year.

Help with sprintf

2005-09-12 Thread Kevin Old
Hello everyone, I'm having trouble with sprintf. I know it's some silly mistake I'm making, but can't seem to figure it out. Here's what I have: my @time = localtime(); $time[4]++; $time[5] += 1900; my $lastmonday = sprintf("%02d", $time[5]) . sprintf("%02d", $time[4]) . '01'; My result is: 20

RE: Use of uninitialized value

2005-09-12 Thread Jeff 'japhy' Pinyan
On Sep 12, [EMAIL PROTECTED] said: I have tried this and I am still getting a similiar error. Here is my perl-cgi code: WHICH line is the uninitialized value warning coming from? my $which_import = $q->param('action') || ''; foreach my $scalar (@imports) { if ($which_import eq 'Import

SOLUTION (was Re: More re: DBI::Proxy failure)

2005-09-12 Thread Mason Loring Bliss
On Mon, Sep 12, 2005 at 12:44:43PM -0400, Mason Loring Bliss wrote: > Mon Sep 12 12:37:03 2005 err, 1, Refusing client So, this was, indeed, PostgreSQL refusing the connection, and not a DBI issue at all. This was masked by DBI::ProxyServer returning a "user could not authenticate" error even wit

RE: Use of uninitialized value

2005-09-12 Thread DBSMITH
"Charles K. Clarkson" <[EMAIL PROTECTED]

More re: DBI::Proxy failure

2005-09-12 Thread Mason Loring Bliss
It seems that when I have dbiproxy log to the terminal, it gives more information, which hopefully will be of some use: Mon Sep 12 12:37:03 2005 err, 1, Error while connecting to DBI:Pg:dbname=oracle as mason: DBI::ProxyServer connect('dbname=oracle','mason',...) failed: FATAL: IDENT authentica

Help with file blob please

2005-09-12 Thread Dermot Paikkos
Hi, Activestate 5.8 and IM 6.2.4 This feels like a silly question to have to ask but I don't understand. I was trying to do something with perl magick and read in the documentation that I need to use a syntax like: name=>string, profile=>blob My problem is that I have never used a blob before

Re: Use of uninitialized value in concatenation (.) or string at txt.pl line 33, line 11

2005-09-12 Thread Jeff 'japhy' Pinyan
On Sep 12, ganesh said: This is the warning messge I am getting when I executed my script. Please find my analysis of the above warning Input: Line 1: 20(1): 125-126 Line 2: 20:125-126 Output: Line 1: 20(1): 125-126 Line 2: 20:125-126 My Code: $line=~s!(\d+)(\(\d+\))?:(\d+)-!$1$2:$3-!

Use of uninitialized value in concatenation (.) or string at txt.pl line 33, line 11

2005-09-12 Thread ganesh
Dear All, This is the warning messge I am getting when I executed my script. Please find my analysis of the above warning Input: Line 1: 20(1): 125-126 Line 2: 20:125-126 Output: Line 1: 20(1): 125-126 Line 2: 20:125-126 My Code: $line=~s!(\d+)(\(\d+\))?:(\d+)-!$1$2:$3-!g; Both the l

RE: Regex - find chars between ()

2005-09-12 Thread Charles K. Clarkson
Jeff Pan wrote: : Charles wrote: : : : : my @array = ( $1, $2, $3, $4 ); : : : : Or this: : : : : my @array = //; : : : Sorry, when I use the second way u mentioned,it can't work. Works for me. use strict; use warnings; use Data::Dumper 'Dumper'; my $h

Re: create a cryptoloop from a perlscript

2005-09-12 Thread Owen
On Mon, 12 Sep 2005 10:05:28 +0200 Mauro Stettler <[EMAIL PROTECTED]> wrote: > 2005/9/12, Mauro Stettler <[EMAIL PROTECTED]>: > > 2005/9/12, John W. Krahn <[EMAIL PROTECTED]>: > > > > im writing a perlscript which should be able to create a cryptoloop > > > > onto a device. the console command to

RE: Regex - find chars between ()

2005-09-12 Thread Jeff Pan
> Why are $1, $2, $3, and $4 in quotes? What's > wrong with this: > > my @array = ( $1, $2, $3, $4 ); > > Or this: > > my @array = //; Sorry, when I use the second way u mentioned,it can't work. the code: while(<>) { next unless /$host/; $_=~/\((\w+)\,\s*(\d+)\)\s+\((\

Re: create a cryptoloop from a perlscript

2005-09-12 Thread Mauro Stettler
2005/9/12, Mauro Stettler <[EMAIL PROTECTED]>: > 2005/9/12, John W. Krahn <[EMAIL PROTECTED]>: > > Mauro Stettler wrote: > > > hi together > > > > Hello, > > > > > im writing a perlscript which should be able to create a cryptoloop > > > onto a device. the console command to do this is losetup /dev

RE: Regex - find chars between ()

2005-09-12 Thread Charles K. Clarkson
Jeff Pan wrote: : Is this feasible? Yes, but ... : while(<>) : { : next unless /$host/; : $_=~/\((\w+)\,(\d+)\)\s+\((\w+)\,(\d+)\)/; What happens if this doesn't match? Then $1, $2, $3, and $4 will be unitialized in the next statement. Better to check

RE: Regex - find chars between ()

2005-09-12 Thread Thomas Bätzler
Jeff Pan <[EMAIL PROTECTED]> asked: > Is this feasible? > > while(<>) > { > next unless /$host/; > $_=~/\((\w+)\,(\d+)\)\s+\((\w+)\,(\d+)\)/; > my @array=("$1","$2","$3","$4"); The quotes around the variables are in fact slowing your code down - you're forcing a string interpolation w

Re: Regex - find chars between ()

2005-09-12 Thread John W. Krahn
Keenan, Greg John (Greg)** CTR ** wrote: > Hi, Hello, > Have a file like: > > meteor(L, 4) (G,24) > rocket(J,19) (D,35) > aulan (E,28) (E, 2) > aupbx (B,32) (O,10) > > And I need to work with the chars between the brackets after I've found the > string on the left e.g. if my $

Re: Regex - find chars between ()

2005-09-12 Thread Jeff Pan
Sorry,it should be: $_=~/\((\w+)\,\s*(\d+)\)\s+\((\w+)\,\s*(\d+)\)/; Didn't consider the blank space before. On Mon, 12 Sep 2005 14:54:56 +0800, "Jeff Pan" <[EMAIL PROTECTED]> said: > Is this feasible? > > while(<>) > { > next unless /$host/; > $_=~/\((\w+)\,(\d+)\)\s+\((\w+)\,(\d+)\)/