Re: Hash of Arrays

2005-09-20 Thread Matija Papec
Christopher Spears wrote: while ($line = <>) { ($who, $rest) = split /:\s*/, $line, 2; @fields = split ' ', $rest; $HoA{$who} = [ @fields ]; } The part that confuses me is: ($who, $rest) = split /:\s*/, $line, 2; I understand that it takes the input and splits it into two parts alo

Re: Can't figure out Error.pm

2005-09-18 Thread Matija Papec
Peter Rabbitson wrote: I then tried to change it in the following way, but I get an error: Can't locate object method "catch" via package "DBException" (perhaps you forgot to load "DBException"?) at ./testerror line 16. ^^^ It seems that you're missing "use DBExc

Re: naming subroutine reference parameter?

2005-09-07 Thread matija
Jeff Pan wrote: >>>my (%hash,@array); >>>&sub_test(\%hash,[EMAIL PROTECTED]); >> >>& has special meaning so it should be dropped when not needing >>particular special behavior. > > > I can't understand for this,can u give me some examples? perldoc perlsub -- &NAME(LIST); # Circumvent p

Re: How do you force SOAP::Lite to use document/literal SOAP messages?

2005-09-06 Thread Matija Papec
David Adams wrote: I am trying to write a simple SOAP client written in perl and to talk to a webservice written in .NET. I am unsuccessful. I believe the web service is expecting document/literal SOAP messages but I think the SOAP::Lite module sends stuff in RPC/encoded messages. Is ther

Re: naming subroutine reference parameter?

2005-09-06 Thread Matija Papec
Jeff Pan wrote: > Passing reference as parameter to subroutine is as easy as the normal > way.And,if u pass some types of parameter such as hash,array,or handle > to subroutine,using reference instead is more safer. > for example,such below code is right: It is, however it could be better. > my

Re: infile data

2005-09-06 Thread Matija Papec
Tom Allison wrote: I've been using the practice of putting something at the bottom of a file for holding static data, like SQL, by calling a __DATA__ handle: my $sql = join('',()); #more efficient my $sql = do { local $/; }; check perldoc perlvar if you want to know more about $/ __DATA__

Re: getting the value of a var

2005-08-28 Thread Matija Papec
> #symbol table > my $st = eval '\%$module::'; correction, my $st = eval '\%'. $module .'::'; > # scalar reference > $sref = *{ $st->{content} }{SCALAR}; > print $$sref; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: getting the value of a var

2005-08-28 Thread Matija Papec
Octavian Rasnita wrote: my $module = "Teddy::Languages::${lang}::${mod}"; eval "require $module"; Then I want to print that value, but I don't know how. I have tried: print Teddy::Languages::$lang::$mod::content; print $module::content; I am missing something and I cannot make it work. Pleas

Re: Analyze Log

2005-08-11 Thread Matija Papec
Nick wrote: Hi There, I am trying to analyze a simple log file and pull 2 pieces of data from it. The log looks as follows: www.example.com 42f3ca1042f8c42f0 73380 3638 Where each valie is tab seperated. I want to create a hash with "www.example.com"

Re: __DATA__ Token Problem

2004-07-05 Thread Matija Papec
Bastian Angerstein wrote: I have a few questions regarding to the DATA Filehandle: 1. This handle ist opend by default or do I have to open it by myself? 2. Is it possible to change to content of what the handle so that the __DATA__ Sektion of my skript changes? 3. Can I delete anything data from D

Re: A few questions

2002-07-11 Thread Matija Papec
qr st uv wx yz"; > >my @matches; > >for my $i (0..9) { >last unless $string =~ /(\w+)/g; >$matches[$i] = $1; >} > >my @I_care_about_these = @matches[-3,-2,-1]; > >#note, if there are less than three matches >#we will get a warning here >pri

A few questions

2002-07-10 Thread Matija Papec
WHERE NAME RLIKE 'john236'; and SELECT EMAIL from Table WHERE 'john236' RLIKE NAME; is not recognized as a valid sql query. :! -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: CGI scripts security

2001-11-27 Thread Matija Papec
h you'd definately know about. No, actually I don't, could you point me somewhere to perldoc? >At the top of your script use: > >#!/usr/bin/perl -wT > >This code won't even work, since it'll be reported as >insecure. When you've worked that bit out, you&#

Re: cgi

2001-11-26 Thread Matija Papec
;close(SENDMAIL) or warn "its all GONE WRONG!!!"; > ># > >I could reefer to each element of %data $data{whatever value} individually but this >seems a bit laborious. > >It would be nice to have a ordered array I could pass straight out. -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

CGI scripts security

2001-11-26 Thread Matija Papec
g like '; rm * ;' can actually execute?(note suffix '.ext') tnx! -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

'' and ""

2001-09-11 Thread Matija Papec
s. ps. I've always used "" but now my boss tells me that this is a bad thing :) -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: PERL IS NOT A HIGH LEVEL LANGUAGE and What is a Script

2001-08-19 Thread Matija Papec
use he simply isn't. IMO, if we were into making an appropriate term it would be more like "compile at runtime" language(like C or any other with one downside? where compiling is done many times). [1] by interpreted I mean "translated and executed line by line, by some kind of

Re: arrays

2001-07-31 Thread Matija Papec
0] }, "") for (0 .. $#datumi2); > >OR > >push(@{ $data[0] }, "") for @dataumi2; Does $_ change in these two examples? (due cycling trough @datumi2) >$data[0] = [("") x @datumi2]; > > >Each has strengths and weaknesses. Can you explain where are these strengths(which one is the fastest?) -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: arrays

2001-07-31 Thread Matija Papec
d::graph::bars module and want to hide all values on X axis. Since I didn't find appropriate attribute for such thing, thought that array of empty strings is good idea. -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: arrays

2001-07-30 Thread Matija Papec
This may look somehow silly but I'm working with GD::Graph module and want to avoid X values being drawn, so there is a need for array where all elements are "". -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

arrays

2001-07-30 Thread Matija Papec
..100); my (@temp, @data); # block for optimization for $i (0..$#datumi2) { push @temp, "" } push @data, \@temp; undef @temp; # end of block for optimization push @data, \@datumi2; . . . -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

GD:Graph

2001-07-27 Thread Matija Papec
("cijena") and little darkblue bars by right Y("volumen"). If you have some experience with gd:graph or some suggestions, please speak. :) -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: question about sort

2001-07-20 Thread Matija Papec
d set of digits in $b >that follow an equal sign. Isn't this "array thing" redundant in this case where we only take zero element? (I can only think of forcing a particular context with such action) -- Matija -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

math

2001-07-20 Thread Matija Papec
I've read somewhere that perl internally uses only doubles. Does this mean that FPU is always used when working with numbers, regardless to the fact that I'm using only integer calculations? (is there a way to force internal use of integers on some variables?) -- Matija -- To unsu

Re: MID in Visual Basic...

2001-07-12 Thread Matija Papec
$1; where $line is your part of text and $price is price. -- Matija

Re: "the right way"

2001-07-10 Thread Matija Papec
rst place thus, y() if $y; could be replaced by: $y >0 and y(); >So, to answer your question, it depends largely on the code your >writing, but mostly on someone's style. tnx. -- Matija

Re: "the right way"

2001-07-10 Thread Matija Papec
x = 0; > >and be done with it. A was thinking more about structures rather then $x manipulating, but this is also nice to know. -- Matija

"the right way"

2001-07-09 Thread Matija Papec
I'm curious which of the two examples is more preferred or it depends entirely on someone style? $x = 1; #1) if ($x) { $x = 0 } #2) $x = 0 if $x; IMO first is more convenient and orthodox but that is just me. :) -- Matija

Re: Editor

2001-07-07 Thread Matija Papec
x27;t implemented, huh? Guess I'm stuck with some weird version. >-Original Message- >From: Matija Papec [mailto:[EMAIL PROTECTED]] >Sent: Friday, July 06, 2001 3:06 PM >To: [EMAIL PROTECTED] >Subject: Re: Editor -- AMD FAQ http://performancefiles.cjb.net/

Re: Editor

2001-07-06 Thread Matija Papec
anton <[EMAIL PROTECTED]> wrote: >I've listen to you all about the editors problem ? >Is anybody out there still using the old bottom-dweller vi ? > >On Fri, 06 Jul 2001 14:48:53 +0200, Matija Papec <[EMAIL PROTECTED]> wrote: >> "Aigner-Torres, Mario

Re: Editor

2001-07-06 Thread Matija Papec
"Aigner-Torres, Mario" <[EMAIL PROTECTED]> wrote: >Hi Bill, > >my choice is gnuemacs Does it support script debugging? I'm looking for nice *nix editor /debugger with breakpoints, step execution, etc. Have you tried PerlComposer? >with cperl! What is cperl? -- Matija

Re: simple regexp

2001-07-06 Thread Matija Papec
gexp in LIST context(i.e. @myips = $line =~ /(blahblah)/g ) in order to evaluate second "blahblah" from $line. If I use $1 and $2, *only* $1 get filled, don't know why.. -- Matija

Re: simple regexp

2001-07-06 Thread Matija Papec
Matija Papec <[EMAIL PROTECTED]> wrote: >Array is a text file with lines as its elements. It looks like: > >--txt file-- ># ARIN: Aworldwidemall.com, VA - US >ALL: 63.64.190.230 ># ARIN: Aworldwidemall.com, VA - US >ALL: 67.64.190.230 >. >. >. >. &g

Re: simple regexp

2001-07-04 Thread Matija Papec
Aworldwidemall.com, VA - US ALL:163.64.190.230 --txt file-- Array is already sorted by IP, so I have to insert a new record somewhere(i.e. 65.64.190.230 between 1st and 2nd record) and write a whole array back to the file. -- Matija

simple regexp

2001-07-04 Thread Matija Papec
splice" says that it only does replacement and truncation. Do you guys have some idea how to make this work? tnx! -- Matija

whoami?

2001-06-26 Thread Matija Papec
Greetings, is there a more elegant way to find out who is running a script? %ENV is not reliable and it doesn't contain USER when booting the system, and "whoami" is external command(yuck :) ) tnx! -- Matija