%x = ( xyx => 'abc' ) is strange!

2003-06-17 Thread Richard Heintze
Why does this program print "yes def" but not "yes xyz"? It does print "xyz:def", so I don't understand why it does not print "yes xyz". { my %x = ( xyx => 'abc', d => 'y', f => 'g' ); $x{"def"} = "fhi"; print qq($_ : ).$x{$_}.qq(\n) foreach (keys %x); foreach (keys %x) { print "yes xyz

Re: Capture a printing function into an array

2003-06-17 Thread Harry Putnam
Mark G <[EMAIL PROTECTED]> writes: [] >> Is there something wrong with printing the line number? > > Nothing @all. you dont need to do <$.>, $. is fine by it self so can scrap > that to > printf " %s %s %-28s %s\n", $., $2, $4, $6; I wanted the brackets in the output. [...] > . . . . . . .

Re: Style ( was:Capture a printing function into an array )

2003-06-17 Thread Tassilo von Parseval
On Mon, Jun 16, 2003 at 11:39:30PM -0700 Harry Putnam wrote: > "Charles K. Clarkson" <[EMAIL PROTECTED]> writes: > > > > > $$line =~ s/[Ss]ource/Src/g; > > $$line =~ s/[Dd]estination/Dst/g; > > $$line =~ /^[^ ]+, (\d[^ ]+ \d[^ ]+).*(Src[^ ]+ \d+).*(Dst[^ ]+ > > Where do I

Re: %x = ( xyx => 'abc' ) is strange!

2003-06-17 Thread Paul Johnson
Richard Heintze said: > Why does this program print "yes def" but not "yes > xyz"? It does print "xyz:def", so I don't understand > why it does not print "yes xyz". > > { > my %x = ( xyx => 'abc', d => 'y', f => 'g' ); Presumably because the key you specified is xyx, not xyz. > $x{"def"} =

Re: %x = ( xyx => 'abc' ) is strange!

2003-06-17 Thread Tassilo von Parseval
On Mon, Jun 16, 2003 at 10:03:50PM -0700 Richard Heintze wrote: > Why does this program print "yes def" but not "yes > xyz"? It does print "xyz:def", so I don't understand > why it does not print "yes xyz". > > { > my %x = ( xyx => 'abc', d => 'y', f => 'g' ); ^^^ > $x{"def"} =

Re: compiling DBD::Oracle

2003-06-17 Thread Rob Anderson
Hi Rob, No, you're not heading down the wrong path, you just need the Oracle **client** installed on your local machine. When recompliling DBI and DBD make sure you've got the following set correctly (appropriate to your set up) ... ORACLE_HOME=/export/home/oracle/OraHome1 PATH=$PATH:/export/hom

Re: while (<>)

2003-06-17 Thread Steve Grazzini
On Mon, Jun 16, 2003 at 10:33:28PM -0700, Bryan Harris wrote: > Pretty neat, Steve, thanks. The only thing that'd be nice to > fix is making it so it gives the usage line if you enter: > > % showme 'ah\d' > > instead of waiting for STDIN. Aside from that it works perfectly. > And I learned a

fetchrow_array

2003-06-17 Thread Benjamin Jeeves
Hi All I my query a MySQL database and have the following code while (@temp = $table->fetchrow_array ()) { some code { my problem is that I want the results from the database query to be access by using $temp[0] for the first row then $temp[1] for the second row and so on. So i

Run as a different user

2003-06-17 Thread Brian Ling
Hi all, I find myself with a rather odd problem, part of a script I'm working on needs to be run as root, another part of the same script need to be run as a different user. The script is started by root, how can I then switch to a different user for a given subroutine/section. The only way I co

Sudden termination for no reason?

2003-06-17 Thread Richard Heintze
My program is terminating for no reason apparent to me! Using the debugger I see that $$curr_true is a 4 element array whose values are , 1, 4, 7. $ev_count is 1. Why would both my debugging session suddenly and my cgi script end when I execute that last statement? Thanks, Siegfried sub F

Re: while (<>)

2003-06-17 Thread Steve Grazzini
On Tue, Jun 17, 2003 at 04:34:04AM -0400, Steve Grazzini wrote: > On Mon, Jun 16, 2003 at 10:33:28PM -0700, Bryan Harris wrote: > > Pretty neat, Steve, thanks. Well don't thank me too soon! Finally occurred to me to try using ARGV in slurp mode, which does indeed do the Right Thing: > #!/usr

Symbolic references and methods

2003-06-17 Thread Tom Gazzini
I can call a method on an object using the following: $objref->func() However, if I try to call this using a symbolic reference: my $func_name = "$objref->func"; &{$func_name)(); then I get the following error: "Undefined subroutine &main::$objref->func called.." The problem is that the perl

Re: Multi-Dimensional Hashes.

2003-06-17 Thread Ramprasad
Tirthankar C. Patnaik wrote: Folks, This may be a naive query, but dashed if I know it. I have a large dataset, of financial data, and I need to check the results of some trading strategies on it. I have read the data into a hash of hashes of hashes, as I believe it's better than re

Re: system function

2003-06-17 Thread Motherofperls
In a message dated 6/16/03 11:35:03 AM Pacific Daylight Time, [EMAIL PROTECTED] writes: > >I tried a couple of those ideas. > > > >I put a BEGIN statement in the script I'm trying to open and > >to my surprise > >it's opened. I'm still getting Error: No such file or directory > > > >The scrip

Re: Symbolic references and methods

2003-06-17 Thread Paul Johnson
Tom Gazzini said: > I can call a method on an object using the following: > > $objref->func() > > However, if I try to call this using a symbolic reference: > > my $func_name = "$objref->func"; > &{$func_name)(); > > then I get the following error: > > "Undefined subroutine &main::$objref->func c

Socket question

2003-06-17 Thread Motherofperls
I have a script that opens a socket on my web server. The script doesn't close the socket. I opened the socket yesterday. When signing back on today the socket was closed and my scripts returns an error. How do I keep a socket open indefinately?

Socket error: Illegal seek

2003-06-17 Thread Motherofperls
I'm getting this error on my unix server from my socket script. The script does fine on my localhost win98 box. What does Illegal Seek mean?

RE: Capture a printing function into an array

2003-06-17 Thread Charles K. Clarkson
Harry Putnam wrote: : : Mark G <[EMAIL PROTECTED]> writes: : : > Nothing @all. you don't need to do <$.>, $. is : > fine by it self so can scrap that to : > printf " %s %s %-28s %s\n", $., $2, $4, $6; : : I wanted the brackets in the output. printf " <%s> %s %-28s %s\n", $., $2, $4, $6; HTH,

Check if webserver is online

2003-06-17 Thread Jaschar Otto
Hi, i own a webserver and i have site on my own PC. I want that the visitors on my server website are able to see if my local PC is online. I've got linux,apache and ISDN on my own PC and i use a dyn dns tool so the IP is not the problem (i've got a somename.no-ip.com) adress. I want i.e. a small

Dereferencing an XML data structure...

2003-06-17 Thread Hamish Whittal
Hi Everybody, I have a data structure as follows (I used XML::Simple to read the XML file) $VAR1 = { 'device' => { 'sysObjectID' => '.1.3.6.1.4.1.9.1.219', 'chassis' => { 'chassisType' => '.1.3.6.1.4.1

RE: Run as a different user

2003-06-17 Thread Brian Ling
Ops I've just been catching up on me list reading, I'd better go and look at $> and $< then. Dow Brian -Original Message- From: Brian Ling Sent: 17 June 2003 09:45 To: '[EMAIL PROTECTED]' Subject: Run as a different user Hi all, I find myself with a rather odd problem, part of a scr

RE: Dereferencing an XML data structure...

2003-06-17 Thread Hamish Whittal
Appologies for not making myself clear first time round. Let me try that again: I have said XML file, which when read in using XML::Simple leaves me with below data structure. Now, I want to end up with: $NEWSTRUCT = { 'device' => { 'sysObjectID' => '.1.3.6.1.4.1.9.1.219', 'commonM

Testing to see if a socket is in use

2003-06-17 Thread Motherofperls
I'm curious if it's possible to make a web page that controls: 1. testing to see if a socket is available 2. if not searching for another socket # 3. use html buttons to open and close sockets. Does anyone have an example of this?

RE: Dereferencing an XML data structure...

2003-06-17 Thread Paul Johnson
Hamish Whittal said: > Appologies for not making myself clear first time round. Let me try that > again: > > I have said XML file, which when read in using XML::Simple leaves me > with below data structure. > > Now, I want to end up with: > $NEWSTRUCT = { > 'device' => { >'sysObjectID' =>

RE: Check if webserver is online

2003-06-17 Thread Dan Muey
> Hi, Howdy, > i own a webserver and i have site on my > own PC. I want that the visitors on my > server website are able to see if my local PC > is online. I've got linux,apache and ISDN on > my own PC and i use a dyn dns tool so the > IP is not the problem (i've got a > somename.no-ip.com) adr

RE: RE: Check if webserver is online

2003-06-17 Thread Jaschar Otto
>Howdy, > >> i own a webserver and i have site on my >> own PC. I want that the visitors on my >> server website are able to see if my local PC >> is online. I've got linux,apache and ISDN on >> my own PC and i use a dyn dns tool so the >> IP is not the problem (i've got a >> somename.no-ip.com) a

RE: fetchrow_array

2003-06-17 Thread Dan Muey
> Hi All Howdy > > I my query a MySQL database and have the following code > > while (@temp = $table->fetchrow_array ()) { > some code > { I think you mean } not { :) > > my problem is that I want the results from the database query > to be access by using $temp[0] for the firs

RE: RE: Check if webserver is online

2003-06-17 Thread Dan Muey
> > > >On server have a script that calls another script on your > home machine > >via LWP. If it gets reply back display "I'm up and running" image If > >not reply then display "I'm asleep now" image. > > > >HTH > > > >Dmuey > > > Sorry, I don't like those 'two-scripts' solutions, > i'd rather

RE: example of placeholders

2003-06-17 Thread Johnson, Shaunn
--howdy. --i think i am getting closer to solving this, but --i have ran into a problem. --the below program works to the point where it --will return the data, but not ALL of the data. --for example, i get only about 50 or so lines when --if i do the queries by hand, i get over 200 with --diff

RE: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Dan Muey
> Hello Dan > Thanks for the response. I tried your suggestion but I still > get the differing sizes... So I'm still looking for a solution. > > >my($size) = `du -sb `; My suggetion just helped you get only the number of bytes it returned into $size instead of the Bytes, whitespace, and dir

RE: example of placeholders

2003-06-17 Thread Dan Muey
> --howdy. Howdy > > --i think i am getting closer to solving this, but > --i have ran into a problem. > > --the below program works to the point where it > --will return the data, but not ALL of the data. > > --for example, i get only about 50 or so lines when > --if i do the queries by hand

RE: example of placeholders

2003-06-17 Thread Johnson, Shaunn
--howdy: --thanks for the reply and the assist. --background and overview: --i am trying to port some tables to --Oracle 9i on my linux box. With PostgreSQL, --i can do a pg_dump and get the table structure --and data ... but because there are some differences --between the two DBs, I can't ju

Re: example of placeholders

2003-06-17 Thread John W. Krahn
Shaunn Johnson wrote: > > --howdy. Hello, > [snip] > > my $list="userlist.txt"; > my $file="newlist.txt"; > my $local_dir=cwd; > > open (DIR, $local_dir) or die "can nae open local directory: $!"; You cannot open a directory with open(), you need to use opendir() for that. However you are no

RE: example of placeholders

2003-06-17 Thread Bob Showalter
Johnson, Shaunn wrote: > --howdy. > > --i think i am getting closer to solving this, but > --i have ran into a problem. > > --the below program works to the point where it > --will return the data, but not ALL of the data. > > --for example, i get only about 50 or so lines when > --if i do the q

RE: example of placeholders

2003-06-17 Thread Dan Muey
> > $sth->execute($dbh->selectrow_array('select distinct > tableowner from > > pg_tables')); > > The selectrow_array() method returns only the first row from > the inner query. Oh yeah, duh, sorry about that, It was a Classic Monday yesterday and it still is today! Sorry for giving you bad in

Assigning an array to a hash

2003-06-17 Thread LoBue, Mark
Hello, Using Perl 5.001 (can't upgrade it, don't ask), I have tried to assign an array to the following hash reference 2 ways, but I can't seem to get it: @[EMAIL PROTECTED]; gives an error: Can't use subscript on associative array slice at ./pump.pl line 60, near "$pumpName}" and: @($pumpData{

RE: fetchrow_array

2003-06-17 Thread Chris Rogers
It sounds more like you want the fetchall_arrayref function. This will return all the records into a single array reference that can accessed by $temp->[x][y] where x defines the record and y defines the field. For example: my $dbh = DBI->connect('DBI:mysql:dbname','user') or die "Couldn't open

Re: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Tony Frasketi
Thanks for all the suggestions folks! I had been trying to find the size of my entire web site by using the 'du -sb ' command in a Perl script to be executed from the Web. But I kept coming up with a diffence of 2,177,024 bytes between the output of the 'du' command when executed from the Perl

RE: Assigning an array to a hash

2003-06-17 Thread Balint, Jess
I think you need to store an array ref(erence). $hash{$what}{$ever} = [EMAIL PROTECTED]; --jess > -Original Message- > From: LoBue, Mark [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2003 2:18 PM > To: [EMAIL PROTECTED] > Subject: Assigning an array to a hash > > > Hello, > > Us

RE: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Bob Showalter
Tony Frasketi wrote: > Thanks for all the suggestions folks! > > I had been trying to find the size of my entire web site by using the > 'du -sb ' command in a Perl script to be executed > from the Web. > > But I kept coming up with a diffence of 2,177,024 bytes between the > output of the 'du'

RE: Assigning an array to a hash

2003-06-17 Thread LoBue, Mark
> -Original Message- > From: Balint, Jess [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2003 12:46 PM > To: 'LoBue, Mark'; [EMAIL PROTECTED] > Subject: RE: Assigning an array to a hash > > > I think you need to store an array ref(erence). > > $hash{$what}{$ever} = [EMAIL PROTECTED]

RE: Assigning an array to a hash

2003-06-17 Thread Bob Showalter
LoBue, Mark wrote: > Hello, > > Using Perl 5.001 (can't upgrade it, don't ask), I have tried to > assign an array to the following hash reference 2 ways, but I can't > seem to get it: > > @[EMAIL PROTECTED]; gives an > error: Can't use subscript on associative array slice at ./pump.pl > line 60,

Re: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Tony Frasketi
Hi Bob Thanks for the response. I checked the system error log and didn't find any Permission Denied errors for the directory in question (xxxtemp). Below is a listing of the directory which contains the offending subdirectory 'xxxtemp'. 'xxxtemp' was an older version of subdirectory 'temp'. There

RE: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Jason . Santos
No, a user needs execute permission on a directory in order to traverse it (i.e., list the contents). -- Jason Santos Sr. Unix System Administrator APS/Pinnacle West Phoenix, AZ USA -Original Message- From: Tony Frasketi [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 17, 2003 1:13 PM To

RE: Assigning an array to a hash

2003-06-17 Thread LoBue, Mark
> -Original Message- > From: Bob Showalter [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 17, 2003 1:00 PM > To: 'LoBue, Mark'; [EMAIL PROTECTED] > Subject: RE: Assigning an array to a hash > > > LoBue, Mark wrote: > > Hello, > > > > Using Perl 5.001 (can't upgrade it, don't ask), I hav

magic open and sed?

2003-06-17 Thread Math55
hi, can i use this: open (DU1,"| du -h -a > /tmp/all 2>/dev/null"); open (DU2,"| find -type d sed| s/^\./d \./ >> /tmp/all"); open (DU3,"| sort +1 /tmp/all > /tmp/LIST"); close(DU1); close(DU2); close(DU3); with magic open? i think sed is not supprted? how can i do exactly this another wa

RE: Assigning an array to a hash

2003-06-17 Thread Bob Showalter
LoBue, Mark wrote: > ... > > Use either: > > > > @{$pumpData{$p_ptId}{$pumpName}{$primary}{solution}} = @solution; > > This worked great, thanks. Why did I think braces were for hashes and > parens were for arrays? I need to go read some more. perldoc perlref contains this statement:

Re: Problem with the Unix 'du' command via perl script

2003-06-17 Thread Tony Frasketi
Hi Jason You are right! I checked it out with a temp directory and played with the permissions. Thanks a bunch! Tony Frasketi [EMAIL PROTECTED] wrote: > > No, a user needs execute permission on a directory in order to traverse > it (i.e., list the contents). > > -- > Jason Santos > Sr. Unix Sys

Help needed regarding Parsing Apache Web log file, access_log

2003-06-17 Thread Anand Babu
Hi all, I am new to this group. I need help regarding a perl script which parses the web log file, access_log. The format of the access_log is: 127.0.0.1 - - [15/Jun/2003:13:54:02 -0100] "GET / HTTP/1.1" 200 34906 The goal is to 1. Perform a count of the pages for the given timestam

RE: magic open and sed?

2003-06-17 Thread Dan Muey
> hi, can i use this: Could you explain in words what you are trying to do? It looks to me like all you want to do is execute command line commands which you don't need to open a pipe for. Try qx(du -h -a > /tmp/all 2>/dev/null); qx(find -type d sed| s/^\./d \./ >> /tmp/all); qx(sort

Parsing the Apache web log file, access_log

2003-06-17 Thread Anand Ayyagary
Help needed for Perl script Hi all, I am new to this group. I need help regarding a perl script which parses the web log file, access_log. The format of the access_log is: 127.0.0.1 - - [15/Jun/2003:13:54:02 -0100] "GET / HTTP/1.1" 200 34906 The goal is to 1. Perfom a count of the pa

Sorry for the duplicate posting! Pl. ignore post #48415

2003-06-17 Thread Anand Babu
Hi all, Sorry for the duplicate posting. Pl. ignore post #48415. Regards Anand - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!

Access DB

2003-06-17 Thread Dan Muey
Hello faithful list! Has anyone worked with Microsoft Access Databases with perl? I either need to run a query on a remote Access Database or Have the people that have that database save it in CSV format or something to import it into mysql. Any ideas how best to deal with Access Databases with

Re: Access DB

2003-06-17 Thread Josh Berkus
Dan, > Has anyone worked with Microsoft Access Databases with perl? > > I either need to run a query on a remote Access Database or > Have the people that have that database save it in CSV format > or something to import it into mysql. > > Any ideas how best to deal with Access Databases with p

RE: Access DB

2003-06-17 Thread Tim Johnson
Here's how I used to connect using DBI and DBD::ODBC. I would pass the access database's name as a parameter. From here you can just use dbi and SQL to manipulate the DB. If you need more help with DBI I would recommend posting in the dbi-users group. my $dbh = DBI->connect("dbi:ODBC:driver=Mi

Re: RE: Check if webserver is online

2003-06-17 Thread Mark G
- Original Message - From: "Jaschar Otto" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, June 17, 2003 9:34 AM Subject: RE: RE: Check if webserver is online > >Howdy, > > > >> i own a webserver and i have site on my > >> own PC. I want that the visitors on my > >> server we

Info req

2003-06-17 Thread Shishir K. Singh
Hello, I am trying to locate the perl code for the opcode -B or stat but I am getting lost in the maze of all the files. Would appreciate it if someone could pls direct me to the actual file where the algo for -B file test switch lies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

RE: Parsing the Apache web log file, access_log

2003-06-17 Thread Rai,Dharmender
module Apache::ParseLog would help you !! > -- > From: Anand Ayyagary[SMTP:[EMAIL PROTECTED] > Sent: Wednesday, June 18, 2003 1:02 AM > To: '[EMAIL PROTECTED]' > Subject: Parsing the Apache web log file, access_log > > Help needed for Perl script > Hi all, > > I

Re: while (<>)

2003-06-17 Thread Bryan Harris
> Finally occurred to me to try using ARGV in slurp mode, which does > indeed do the Right Thing: > >> #!/usr/bin/perl -l >> use strict; >> use warnings; >> >> die usage() if (@ARGV == 0) >> or (@ARGV == 1 and -t STDIN); >> >> my $pattern = shift; >> l

Re: Info req

2003-06-17 Thread Tassilo von Parseval
On Wed, Jun 18, 2003 at 12:38:35AM -0400 Shishir K. Singh wrote: > I am trying to locate the perl code for the opcode -B or stat but I > am getting lost in the maze of all the files. Would appreciate it if > someone could pls direct me to the actual file where the algo for -B > file test switch