Re: Autmatic function creation

2004-11-17 Thread Dave Gray
Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > [snip] > : : foreach my $method ( keys %InheritableClassData ) { > : : no strict 'refs'; > : : *$method = sub { > : : shift; > : : $InheritableClassData{$_} = shift if @_; > : : return $InheritableClassData{$_}; > : :

Re: Recursive function

2004-11-17 Thread Dave Gray
> The purpose is simple, search directory inside $depth levels for > directories. No need to reinvent the wheel: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: module installation

2004-11-17 Thread Dave Gray
> and I have PERL5LIB defined in my .bash_profile > > export > PERL5LIB=/home/gwes/usr/local/lib/perl5/5.6.0:home/gwes/usr/local/lib/site_perl/5.6.0 This looks broken... try: export PERL5LIB=/home/gwes:/usr/local/lib/perl5/5.6.0:home/gwes/usr/local/lib/site_perl/5.6.0 Note the colon after '

Re: Recursive function

2004-11-23 Thread Dave Gray
> I know I can use the "find.pm". But, I'd like to know why the recoursive > I did is wrong. There are no debug print statements in your code. There are also a lot of 'next' statements, which always make me suspicious. See comments in chopped-up code below. Good luck, Dave > == Start of code [sn

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
> Is there a more compatible way to check my overly-long string? How about: die "syntax error\n" if $msgs =~ /[^\d,]/; Cheers, Dave -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: regex seg fault on long string

2004-12-02 Thread Dave Gray
On Thu, 2 Dec 2004 17:19:00 -0500, Dave Gray <[EMAIL PROTECTED]> wrote: > > Is there a more compatible way to check my overly-long string? > > How about: > > die "syntax error\n" if $msgs =~ /[^\d,]/; Oh, I missed a requirement... after the above code: while (

Re: LWP getstore

2004-12-03 Thread Dave Gray
> I'm having trouble w/ getstore... It works fine when I use it like this [snip] > ... but when I use in the script below, all that happens is the files are > created but they are only 1kb and can not be displayed... When I use the > script above the file size is 14kb and looks great... Obvio

Re: Perl regrp 101 -- correction

2004-12-03 Thread Dave Gray
> ## This Does what I want !! > $tmp ="Joe Smore1qazxswedcvfrtgbnhytujmkilptyot5000"; > ($tmp) = $tmp =~ m/^(\w{3})/; > print "$tmp\n"; ## "Joe" > > Why does $tmp need '(...)' ?? Regular expression matches return ($1, $2, ...) in list context. The parentheses force that. -- To unsubscribe,

Re: Should be a simple substitution?

2004-12-06 Thread Dave Gray
> I'm looking for a regex (or a couple of regexes) to do the following: > > blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah > blahblah{a,b,c}blah --> blahblah(a|b|c)blah Anybody have a faster way to do this? __CODE__ #!/usr/bin/perl use strict; use warnings; sub uncommify { my ($glob

Re: Should be a simple substitution?

2004-12-08 Thread Dave Gray
> I think the ?: must be extraneous: That construct lets the regex engine know that it doesn't need to worry about saving backreferences to the parenthesized group. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Should be a simple substitution?

2004-12-08 Thread Dave Gray
> It's on the right hand-side of the regex, however. Look at the output: > > C:\src\perl>perl -pe"s<{([^}]+)}><(?:@{[ ($a = $1) =~ y/,/|/ && $a ]})>" > blargh{a,b,c}blargh > blargh(?:a|b|c)blargh > > The OP didn't want the ?: in there So it is! I'm usually a fan of one-liners, but I think t

Re: basic search engine

2004-12-15 Thread Dave Gray
> I am planning to write a simple search engine. The engine would be > able to search for a word or phrases from a file and probably point > the user the line number the word is found. > The issue is I want the engine to be able to support more advance > search techniques which means it could suppo

Re: control loop question

2004-12-14 Thread Dave Gray
> Let's say I have a text file filled with: > > stuff > stuff > stuff > Users sometext > tom > dick > harry > Users more sometext >larry >curly >moe >

Re: regexp for a blank line

2004-12-14 Thread Dave Gray
Christopher Spears [mailto:[EMAIL PROTECTED] wrote: > I have to write a script that processes text in a > file. The text includes lots of blank lines. How can > I tell Perl to skip the lines? On Tue, 14 Dec 2004 11:22:54 +0530, Mallik <[EMAIL PROTECTED]> wrote: > next if ($line =~ /^\s*$/); +1

Re: Can someone translate a small .PY to Perl?

2004-12-28 Thread Dave Gray
> was wondering if there were a translation in PERL so I could have my Netware > servers send heartbeats to the heartbeat server? > > Title: PyHeartbeat - detecting inactive computers > Submitter: Nicola Larosa > > # Filename: HeartbeatClient.py > > """Heartbeat client, s

Re: Can someone translate a small .PY to Perl?

2004-12-29 Thread Dave Gray
On Wed, 29 Dec 2004 12:50:21 -0500, GMane Python <[EMAIL PROTECTED]> wrote: > while ( <> ) { That isn't doing what you expect, which (I assume) is an infinite loop. <> loops over @ARGV and attempts to open each arg as a file and iterate over the lines in each. I suppose it is functionally a somewh

Re: Copying a hash-of-hashes

2004-12-30 Thread Dave Gray
> The question is whether there is an elegant way to produce a complete copy > of a hash-of-hashes-of-hashes-...-of-hashes for internal subroutine purposes > and make sure that all references will be translated properly as well, > leaving the subroutine no ability to modify the main hash. You migh

Re: Is GOTO evil?

2005-01-06 Thread Dave Gray
On 6 Jan 2005 16:11:40 -, Peter Scott <[EMAIL PROTECTED]> wrote: > The only times I've used goto in Perl have been the > "goto &sub" form, which isn't much of a goto in > the first place :-) I use it the most when I'm debugging. For example, if I'm hacking on a webpage with a bunch of redirect

Re: Memory full

2005-01-12 Thread Dave Gray
> Here is an example of a program and a perl module that parses a .xls file > and eats the whole memory. > I have tried it under Linux and Windows and it has the same problem under > both OSs, so it has big bugs. [snip] > #Insert into database > my $rapoarte_i = $dbh->prepare("insert ignore into te

Re: Regex lookahead problem

2005-01-14 Thread Dave Gray
On Fri, 14 Jan 2005 07:11:30 +, Andrew Black <[EMAIL PROTECTED]> wrote: > Can someone explain how lookaheads work and give an example of using one > Cheers I find the full names of these regex constructs to be quite enlightening: "zero-width (positive|negative) look-(ahead|behind) assertion".

Re: Regex help

2005-01-16 Thread Dave Gray
On Sat, 15 Jan 2005 01:25:21 -0800 (PST), Ajey Kulkarni <[EMAIL PROTECTED]> wrote: > I'm trying to match a floating point in ada. > They are normal floating points with 2 extra things.(they can or can't > come) > > 1. an underscore is permitted between the digits and > 2. An alternate numeric bas

Re: Regex help

2005-01-17 Thread Dave Gray
On Mon, 17 Jan 2005 08:37:07 +0100, manfred <[EMAIL PROTECTED]> wrote: > > That leads me to a question :-) > > >> if ($num =~ /^(\d+)\#([^\#]*?)\#(?:e\+(\d+))?$/x) { > > What particular use has the _x_ modifier in this example? > I mean the hashes are escaped? I forgot to remove the /x when I

Re: Substitute Varaible

2005-01-17 Thread Dave Gray
On Mon, 17 Jan 2005 16:11:54 +0530, Anish Kumar K. <[EMAIL PROTECTED]> wrote: > Hi I need help regarding substituion of varaibles with values > > Say I have a txt file (a.txt) > > which has only one line: > Hi $name > > The PL file > use strict; use warnings; > open INPUT, "a.txt"

Re: regular expression question

2005-01-17 Thread Dave Gray
> I am new to perl, I receive some spam email with subject like "st0ck, > 0pportunities, gr0wth...", how can I match those words with number "0" in Something like __CODE__ use warnings; use strict; use Data::Dumper; # add to this hash to make it slower my %rep = ( 'a' => [4], 'e' => [3], '

Re: Dynamic pattern matching?

2005-01-18 Thread Dave Gray
> I know I can write an if() clause to match every possible case, but I'm > wondering if there is a more general approach that would allow me to > dynamically match a varying number of extra columns within a single > expression. You could shove all the data points into one parenthetical group in t

Re: PERL with grep

2005-01-21 Thread Dave Gray
> I would like the script to do the following: > 1) List all *.java files containing following patterns: >double, parseDouble Sounds to me like you don't need to resort to perl yet with this problem... egrep -rHis '\bdouble\b|\bparsedouble\b' /path/to/dir/ -- To unsubscribe, e-mail: [EMAIL

Re: Module to work like a google engine index

2005-01-21 Thread Dave Gray
> I would like to know if any one knows a perl module, which working like a > index engine, on text documents or PDF documents or Word documents (like > google to desktop, ou lucene API). It's not a module, but Glimpse can do what you describe. -- To unsubscribe,

Re: How to find regex at specific location on line

2005-01-24 Thread Dave Gray
> 'plain_regex'=> sub { if ( $string =~ /^.{38}\|[BNPG]\|/ ) { > my $a = $_ } }, > 'plain_regex'=> sub { if ( $string =~ /^.{38}\|N\|/ ) { my $a = $_ } > }, > > What was interesting to me was that although, predictably, the > substring/regex combo was consistently the best perform

Re: Compile perl code/files via STDIN

2005-02-01 Thread Dave Gray
> i want to open a perl process and enter the code/files to compile via > STDIN. i know it is possible. but how? > does somebody know a tutorial or something like this which explains how > i can compile perl code via STDIN? $ perl print "Hello from STDIN\n"; ^D Hello from STDIN $ If the answers

Re: Compile perl code/files via STDIN

2005-02-02 Thread Dave Gray
> yes that is exactly what i mean. i want to do somthing like this: > > $ perl - c > print "Test\n"; > > and now i want to get the infos of the compilation (sytax ok or errors...). > after that i want to put the next perl code into the > process, i don't want to close the

Re: Regex Multi line match

2005-03-08 Thread Dave Gray
> This is the multi line pattern in which I wish to match: > > > String 1.2.3.4.5.6 > > One way to solve this would be to read lines from the file and save chunks of N lines (4 in this case) in a temp variable. Then your regex would operate on enough of the file to have a chance of working.

Re: Regex Multi line match

2005-03-08 Thread Dave Gray
> > Something like (untested): > > > > my (@lines, $num) = ((), 4); > > while () { > > push @lines, $_; > > shift @lines if @lines == $num+1; > > print 'lines '.($.-$num+1).' to '.($.)." match\n" > > if join('',@lines) =~ /regex goes here/; > > } > > > > That assumes that the pattern bei

Re: Regex Multi line match

2005-03-08 Thread Dave Gray
> > my (@lines, $num) = ((), 4); > > You are assigning the list ((), 4) to @lines and nothing to $num. Perhaps you > meant: > > my ( $num, @lines ) = ( 4, () ); > > Or simply: > > my ( $num, @lines ) = 4; Indeed, good catch. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

Re: pack-unicode problem (z/OS)

2005-03-11 Thread Dave Gray
> I am running perl 5.8.6 on z/OS unix. I am doing these : > > $u = unpack"U0U", "\x8a\x73"; > print "\n\$u : $u"; > > $p = pack("U0U", $u); > print "\n\$p : $p"; Are you running with strict and warnings turned on? Because I'm getting "Malformed UTF-8 character" messages running this: #!/usr/

Re: z/OS unicode error.

2005-03-15 Thread Dave Gray
> Are you running with strict and warnings turned on? Because I'm > getting "Malformed UTF-8 character" messages running this: > > #!/usr/bin/perl > use strict; > use warnings; > > my $u = unpack"U0U", "\x8a\x73"; > print "\$u: $u\n"; > > my $p = pack("U0U", $u); > print "\$p: $p\n

Re: [PBML] Query about perl modules

2005-03-16 Thread Dave Gray
> blade:~/personal/perl > cat -n check.p > 1 #!/usr/bin/perl > 2 > 3 use Net::Telnet; > 4 > 5 $timeout = 10; > 6 $obj=new Net::Telnet( [Timeout => $timeout,] ); > 7 > blade:~/personal/perl > perl check.p > unknown remote host: ARRAY(0x22494) at check.p line 6

Re: I think I need another regex...

2005-03-17 Thread Dave Gray
> I tried to do this with split(), but it's not working good at all > > The string: > interface=something very long with spaces and all > mac-address=00:02:6F:36:2D:31 ap=no wds=no rx-rate=11Mbps tx-rate=11Mbps > packets=12623,18377 bytes=10829240,2009327 frames=12623,18377 > (the above is one

Re: I think I need another regex...

2005-03-17 Thread Dave Gray
On Thu, 17 Mar 2005 11:32:23 -0500, Dave Gray <[EMAIL PROTECTED]> wrote: > > I tried to do this with split(), but it's not working good at all > > > > The string: > > interface=something very long with spaces and all > > mac-address=00:02:6F:36:2D:31 a

Re: Redirect on the pushing button

2005-03-31 Thread Dave Gray
> I am create edit data form, and it ask visitor: "do you wish edit data?" > All is ok with Yes button, but I don't kniw what with No button :-) > I wish that clicking NO button recirect me on some URL.. You can do this in perl by sending a Location header back to the browser before you send Conte

Re: Redirect on the pushing button

2005-03-31 Thread Dave Gray
> You can do this in perl by sending a Location header back to the > browser before you send Content-type a la: > > #!/usr/bin/perl > use strict; > use warnings; > use CGI; > use CGI::Carp 'fatalsToBrowser'; > > my $cgi = new CGI; > my $form = $cgi->Vars; > > if ($form->{no}) { > print "Locati

Re: nested replace string

2005-04-11 Thread Dave Gray
> Please help me in where I am going wrong and suggest me the solution. Since you have the data in nice XML format, why not use an XML parser instead of parsing it yourself? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: one-liner multi-line regex problem

2005-04-25 Thread Dave Gray
> I'm trying to write a perl one-liner that will edit an iCalendar > format file to remove To Do items. The file contains several > thousand lines, and I need to remove several multi-line blocks. The > blocks to remove start with a line "BEGIN:VTODO" (without the quotes) > and end with a line "EN

Re: looping over a tied hash problem

2005-05-10 Thread Dave Gray
I'm kind of lost as to what you're actually trying to do. Instead of posting functions with nothing calling them, you should include a code snippet (as simple as possible) that can be run to demonstrate the problem. Preferably not using those functions. Fix one thing at a time. With that said, thi

Re: looping over a tied hash problem

2005-05-11 Thread Dave Gray
> Dave, I've got some more code here that should explain exactly what I'm > trying to do, what do you think of the structure? As you can probably tell > I'm having problems accessing the keys and values from a tied hash, any > ideas how I can get the keys and the values printed to the screen? > >

Re: Threads related document to refer in perl

2005-05-16 Thread Dave Gray
> I want to create threads using perl. > > So if any documents or links are there to refer please send me. Here's some pretty basic threading code: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Re: Attempt to free unreferenced scalar

2005-05-16 Thread Dave Gray
> After running a program, I saw the following errors: > > Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: > 0x162445c > at E:/usr/lib/Errno.pm line 15 (#1) > Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter: > 0x162445c at E:/usr/lib/Errno.pm line 15. The

Re: A very general question to perl experts

2005-05-17 Thread Dave Gray
> sub readDefectData { > my $defectDataFH=new FileHandle; > open ($defectDataFH,$_[0]) or die "Error: Cannot load defectivity > data, $_[0]\n"; > print "Loading defect data ... "; > my %short; > while ($_=$defectDataFH->getline) { > chomp; >

Re: Determine structure size

2005-05-17 Thread Dave Gray
> Is there a way to determine how much a certain data structure costs in terms > of memory? In other words is there some built in command or module that > takes a reference to a nested data structure and gives a ball park idea of > how much memory this structure takes.

Re: efficiency of hash of hashes/lists

2005-05-24 Thread Dave Gray
On 5/23/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > On Mon, May 23, 2005 at 01:40:08PM -0400, Zhenhai Duan wrote: > > I tried hash (where the members of a group are joined with ":"), and hash > > of hash. It happended that hash of hash is slower than single hash. > > > > Hash: > > $groups{$g1}

Re: efficiency of hash of hashes/lists

2005-05-24 Thread Dave Gray
> > # access test for 2d > > ($su, $ss) = times; > > for my $i (0 .. $hashsize-1) { > > $oned{$l1[$i]}{$l2[$i]}++ > > I think you should be operating on %twod here. LOL, thanks. Original poster take note: generating hashes..! base 0.03 0.00 0.03

Re: Can't use subscript in angle brackets

2005-05-25 Thread Dave Gray
> foreach my $file ( @ARGV ){ > if( my $fh = new IO::File $file ){ # Be explicit[1] if (my $fh = IO::File->new($file)) { > push @infh, $fh; > } else { > die "Failed to open input file '$file': $!"; > } > } [1] -- To u

Re: Favorite packages for benchmarking?

2005-06-03 Thread Dave Gray
On 6/2/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > Siegfried Heintze wrote: > > There are lots of packages for date-time computations. What is the best one > > for timing computations for benchmarks? I'm thinking I want to fetch the > > time in 64 bit format instead of year, mo, day, hour, min,

Re: Re: file parsers (fwd)

2005-06-03 Thread Dave Gray
On 6/3/05, Chris Devers <[EMAIL PROTECTED]> wrote: > This was really annoying. > > Please, please, please: do not sign up for a mailing list using one of > these challenge/response email systems. It's a waste of everyone's time. +1 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: @array =to=> $array

2005-06-10 Thread Dave Gray
> my $localtime; > @$localtime{qw / second minute hour mday month year weekday yearday isdst /} = > localtime(time); > > [1] A style nit: Speaking of nitpicks: my %localtime; > If you DO need to iterate across all the indices for an array ( rarely > necessary if you have designed your data corre

Re: host id

2005-06-10 Thread Dave Gray
On 6/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I whole heartedly agree! > > top post rules! Apparently, so does Lotus Notes. My deepest sympathies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: host id

2005-06-10 Thread Dave Gray
On 6/9/05, Wiggins d'Anconia <[EMAIL PROTECTED]> wrote: > 4. Speed/Forking: because backticks causes a fork, you are using system > resources in a way you wouldn't necessarily need to if you were able to > use a built-in function. When Perl forks, it forks an exact copy of the > running process and

Re: @array =to=> $array

2005-06-10 Thread Dave Gray
On 6/10/05, Lawrence Statton <[EMAIL PROTECTED]> wrote: > > > my $localtime; > > > @$localtime{qw / second minute hour mday month year weekday yearday isdst > > > / > > } = > > > localtime(time); > > > > > > [1] A style nit: > > > > Speaking of nitpicks: > > my %localtime; > > Assuming you are su

Re: @array =to=> $array

2005-06-10 Thread Dave Gray
On 6/10/05, Lawrence Statton <[EMAIL PROTECTED]> wrote: > > Huh. So it does... that doesn't look like it's making a reference, > > though. I think I would write that as @{$localtime}{ ... } for > > clarity. > > As to the clarity question. To my eyes, I find spurious {} tend to > diminish rather t

Re: hashes and loops

2005-06-15 Thread Dave Gray
On 6/14/05, Karyn Williams <[EMAIL PROTECTED]> wrote: > Below is code that I found on the web that I slightly modified. I am trying > to create a script to remove from a file (tlist) the items in another file > (tnames). This works but I have multiple files (tlist) I need to check > against. I'm no

Re: How to handle Null-Charakters

2005-06-22 Thread Dave Gray
On 6/22/05, Angerstein <[EMAIL PROTECTED]> wrote: > I have a problem reading strings out of a binaery file. > > The last 128 Byte of the File contains a String I want to work with. > > (sorry, this code is windows, feel free to flame me ^^) > > my $tsize = 128; >

Re: creating html interface for the perl code

2005-06-22 Thread Dave Gray
On 6/22/05, Aditi Gupta <[EMAIL PROTECTED]> wrote: > I've to create html inteface for a perl code. I've to get the input from the > user and the data entered in the form has to be processed and output(which > is a graph) has to be displayed to the user. But i don't know how to do > it... I am advic

Re: how to append blocks in same file

2005-06-22 Thread Dave Gray
On 6/22/05, Aditi Gupta <[EMAIL PROTECTED]> wrote: > Since i'm using activestate perl on windows xp i don't know whether paste > will work or not. > I'll try the hash of array. Using a hash of arrays will not necessarily preserve the order. Below is the start of an array of arrays solution. I'll l

Re: Syncsave Integers 7Bit Data +1 sync bit... How do I get my value out of it?

2005-06-22 Thread Dave Gray
On 6/22/05, Angerstein <[EMAIL PROTECTED]> wrote: > The mp3 format uses something (sick) called syncsave integer. > > If you have a 4 Byte 32 Bit the very first bit of every Byte is used > as a syncsave bit. so you can only put a 28 Bit long Number in it. > > Puting stuff in this format is the on

Re: how to append blocks in same file

2005-06-22 Thread Dave Gray
On 6/22/05, Dan Klose <[EMAIL PROTECTED]> wrote: > > > Using a hash of arrays will not necessarily preserve the order... > > If you don't want to worry about sorting the order of the blocks i.e. > doing it yourself then use Tie::IXhash (something like that on CPAN) to > preserve the order, you th

Re: deleting ldap users question

2005-06-27 Thread Dave Gray
On 6/27/05, Graeme McLaren <[EMAIL PROTECTED]> wrote: > Hi all, I am trying to delete entries from an LDAP server and I don't > understand why my code is not deleting the relevant entries. [snip] > here is my code: > # > #!/usr/bin/perl >

Re: Logger output behavior not wanted

2005-06-27 Thread Dave Gray
On 6/27/05, Pablo Wolter <[EMAIL PROTECTED]> wrote: > Hi, > > I have some troubles to figuring out by myself a way to add the output > of a script that I run by system function in perl into a logger. The > code I have is: [snip] > print LOG "-- $hostName Database backup\n"; > print LOG "--

Re: Run a subroutine, then replace subroutine and run again

2005-06-28 Thread Dave Gray
On 6/27/05, Wagner, David --- Senior Programmer Analyst --- WGO <[EMAIL PROTECTED]> wrote: > Sorry, but I have two subroutines with the same name which is fine > because I have not had a need to use the hashes which these two similar > subroutines created. > > How do I run the su

Re: usage of do {}

2005-06-30 Thread Dave Gray
On 6/30/05, Peter Rabbitson <[EMAIL PROTECTED]> wrote: > Here and there on the web I encounter claims that the do {} operator is > depreciated. However I find it convenient to do things like: > > eval { some stuff } or do { some multiline error handling }; > > is this a bad practice? No, that's

Re: usage of do {}

2005-06-30 Thread Dave Gray
On 6/30/05, Jay Savage <[EMAIL PROTECTED]> wrote: > Checking for $@, though, is a must no matter what you're using [eval] for. +1 despite my completely missing that omission earlier! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Atmoic operations in Multi-threaded Perl?

2005-07-07 Thread Dave Gray
On 7/6/05, Siegfried Heintze <[EMAIL PROTECTED]> wrote: > Can I assume that an auto-increment operation on an integer value is atomic > (that is, cannot be interrupted by another thread)? This is a common > assumption in C/C++. The perl debugger I use leads me to believe that perl > stores all int

Re: Using Config files and variables.

2005-08-01 Thread Dave Gray
On 7/31/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > problem is that the variables in the config are not being translated into > there actual values before they get used. So you have a plaintext config file with variable names in it that you want perl to interpolate at some point once the co

Re: 'Use Lib' problem...

2005-08-01 Thread Dave Gray
On 7/26/05, Tony Frasketi <[EMAIL PROTECTED]> wrote: > I'm trying to use the following 'use lib' statement as described at > http://www.unix.org.ua/orelly/perl/prog3/ch31_13.htm It's not nice to link to pirated copies of books. BAD. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I think I am on the right track as far as what assertion to use. I need to > print from one string to another using .. with \G Why do you want to use \G? > My goal is to capture from allsets down. > Here is my code: > > #!/usr/bin/perl >

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > technically you are correct about escaping the dot, but in this particular > situation my regexp is working. I will escape the dot. > my goal again is to print from one sting to another from "allsets" > down. I apologize for the long o

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > yes but the problem is my start point and end point have identical entries > under them. It is stopping at original1.1 when I need for it to stop at > the end of original1.1 and print > > media: sf > Volumes: >STK000 > Total space av

Re: reg exp using \G

2005-08-02 Thread Dave Gray
On 8/2/05, Dave Gray <[EMAIL PROTECTED]> wrote: > On 8/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > yes but the problem is my start point and end point have identical entries > > under them. It is stopping at original1.1 when I need for it to stop at > >

Re: firing an external program and exiting

2005-08-02 Thread Dave Gray
On 8/2/05, Ram <[EMAIL PROTECTED]> wrote: > I have a situation where a CGI script has to start an independent perl > script and exit without capturing the output or waiting for the exit code. > It doesnt make any practicle sense to me as this perl script takes good 6 > hours to run and my CGI scrip

Re: firing an external program and exiting

2005-08-02 Thread Dave Gray
On 8/2/05, Ram <[EMAIL PROTECTED]> wrote: > > > > I tried > > > > > > exec("command"); > > > and also > > > system("command &"); > > > > > > Niether seemed to work, for the reason which I assume is, since it is a > CGI > > > script and webserver waits until this script exits and then displays the

Re: firing an external program and exiting

2005-08-03 Thread Dave Gray
On 8/2/05, Ram <[EMAIL PROTECTED]> wrote: > I have a situation where a CGI script has to start an independent perl > script and exit without capturing the output or waiting for the exit code. > It doesnt make any practicle sense to me as this perl script takes good 6 > hours to run and my CGI scrip

Re: Backup of a subroutine

2005-08-03 Thread Dave Gray
On 8/3/05, John W. Krahn <[EMAIL PROTECTED]> wrote: > marcos rebelo wrote: > > I need to redefine localy one subroutine and have it correctlly after. > > How do I do it? > > $ perl -e' > my $myPrint = sub { print "Teste 1\n" }; > > sub test { $myPrint = sub { print "Teste 2\n" } } > > $myPrint->

Re: naming subroutine reference parameter?

2005-09-06 Thread Dave Gray
On 9/6/05, Jayvee Vibar <[EMAIL PROTECTED]> wrote: > How do you name subroutine reference parameter in perl? > Naming a local or pass by value is by simply using my ($param1, $param2) = > @_ ; > How about by reference? I think it would be harder if I'll be using $_[0], > $_[1] direct method. > Is i

Re: WELCOME to beginners@perl.org

2005-09-28 Thread Dave Gray
On 9/28/05, Ryan Frantz <[EMAIL PROTECTED]> wrote: > Just for giggles, I'm gonna assume that you're using PPM (you gave > nothing else to go on)... > > I've only installed this particular module using ActiveState's 'ppm' > myself; it seems to have problems with the '::' in module names. If ppm > c

Re: Finding directories within a tree

2005-10-07 Thread Dave Gray
On 10/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am receiving numerous amounts of mail but have not filled out any > questionnaires giving away any sort of information. If these letters continue > being sent to me I will be forced to report you to AOL as spam and possibly > other for

Re: Finding directories within a tree

2005-10-07 Thread Dave Gray
On 10/7/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Good Afternoon > > I am attempting to develop a script that will parse a directory listing and > return only directory names that match a given expression. > > It would make sense to me to use File::Find to do this but based on the dir >

Re: Fwd: Parsing web pages

2017-03-03 Thread Dave Gray
The submodules WWW::Mechanize::Firefox or WWW::Mechanize::PhantomJS are worth a look too, depending on the complexity/js-heaviness of the pages you're parsing and what your setup looks like exactly (full headless; on your computer, etc). On Fri, Mar 3, 2017 at 1:39 AM, Lars Noodén wrote: > On 03

Re: Thank you for your answer. And yesterday i was write from Nahid`s email address

2005-10-17 Thread Dave Gray
On 10/17/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > This is a file is info.xml and it constraint below > > > > Ulfet > TANRIVERDIYEV > 24 > BAKU > > > Xetai 191 > Qafqaz University > > > > > So, i wrote script in PERL. An

Re: Alcatel CORBA 5620 OSS

2005-10-17 Thread Dave Gray
On 10/17/05, Tielman Koekemoer (TNE) <[EMAIL PROTECTED]> wrote: > We have an Alcatel CORBA 5620 gateway from which we have extract > information. Does anyone know of a module that would enable Perl to > access this service? > > I searched the CPAN's archive but could not find anything. Apologies >

Re: having problems with index of a date string

2005-11-16 Thread Dave Gray
On 11/11/05, kathyjjja <[EMAIL PROTECTED]> wrote: > I am trying to add the date to a file name. [snip] Usually when I want to do something like this, it's to make a uniquely named temp file, so the date doesn't need to be human readable, so something like this works just fine: # filename__ my $tm

Re: combining array ref's

2005-11-16 Thread Dave Gray
On 11/13/05, Tom Allison <[EMAIL PROTECTED]> wrote: > my $A = [1,2,3,4,5,6,7,8,9]; > my $B = [11,12,13,14,15,16,17,18,19]; > > timethese(1000, > { > 'plain' => 'my $array = [$A, $B];', > 'loopy' => 'push @$A, $_ foreach @$B;' > }); Another im

Re: new for regular expression in Perl

2006-01-04 Thread Dave Gray
On 1/4/06, chen li <[EMAIL PROTECTED]> wrote: > I think it might be natural for me to read the file > line by line and get the return position looks like > these(just an example), similar to do the word search > in microsoft Word, which is what I really want: > > match in line 1 and the end of matc

Re: pack an array

2006-01-04 Thread Dave Gray
On 1/2/06, John W. Krahn <[EMAIL PROTECTED]> wrote: > Gerard Robin wrote: > > Hello, > > Hello, > > > I guess that one can write in more perlish fashion that I did: the part > > between the of this script to pack the array @array. > > > > Please, can someone give me some hint ? > > You don't n

Re: regex one liner

2006-03-21 Thread Dave Gray
On 3/21/06, Kevin Viel <[EMAIL PROTECTED]> wrote: > > BTW, out here in the real world (that would be UNIX), *.pl stands for > > Perl Library file, not a script. > > What extension do you suggest using, if any, in the real world? .ps for perl script /snicker -- To unsubscribe, e-mail: [EMAIL PROT

Re: Very Basic Web Scrape

2006-04-07 Thread Dave Gray
On 4/7/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Fri, 07 Apr 2006 16:02:53 -0400, Oliver Block <[EMAIL PROTECTED]> > wrote: > >> I understand regex, but the following fails: > >> open PAGE, 'c://redcross.htm'; > >> while( my $line = ) { > >> $line =~ /Health and Safety Classes/ > >> pr

Re: Python - NOT TROLLING

2006-04-25 Thread Dave Gray
On 4/25/06, Paul D. Kraus <[EMAIL PROTECTED]> wrote: > I am picking up python and messing around with it and I always come running > back to perl :) > At any rate I am curious what the more experienced programmers think of the > language and its uses. One thing that a lot of people like about Pyth

Re: Counting & arrays

2006-05-22 Thread Dave Gray
On 5/22/06, Michael Gargiullo <[EMAIL PROTECTED]> wrote: It's been a while since I've used Perl and I need some help with a multidimensional array. I have a file that I need to compile some stats on. I need to keep track of 'actions' and 'rules'. Yes, stats from a firewall. Both 'actions' and

Re: Servlet

2006-06-05 Thread Dave Gray
On 5/30/06, Tom Allison <[EMAIL PROTECTED]> wrote: How can I impliment a Servlet in Perl without writing my own http server or running apache? What exactly are you trying to do? I assume you didn't get a response because you weren't very specific. -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

Re: An array like line that I do not understand

2006-06-16 Thread Dave Gray
On 6/16/06, Alan_C <[EMAIL PROTECTED]> wrote: [snip] 1 'build' slack build slackbuild sbuild pkg 2 'build' slack build slackbuild sbuild pkg 3 'build' slack build slackbuild sbuild pkg 4 'kernel' slackware 2.6 kernel howto 5 'kernel' kernel compile install 2.6 6 'build' building a linu

Slurping a big file (WAS: Netiquette)

2006-06-23 Thread Dave Gray
On 6/23/06, Omega -1911 <[EMAIL PROTECTED]> wrote: Shawn, I modified your example like so, was this correct? chomp( my $data1 = ); # line 1 chomp( my $data2 = ); # line 2 chomp( my $data3 = ); # line 3 chomp( my $data4 = ); # line 4 chomp( my $data5 = ); # line 5 while( ){ c

Re: Slurping a big file (WAS: Netiquette)

2006-06-24 Thread Dave Gray
On 6/23/06, Omega -1911 <[EMAIL PROTECTED]> wrote: On 6/23/06, Dave Gray <[EMAIL PROTECTED]> wrote: > On 6/23/06, Omega -1911 <[EMAIL PROTECTED]> wrote: > > Shawn, I modified your example like so, was this correct? > > > > chomp( my $data1 = ); # lin

Re: Randal L. Schwartz is Wrong (WAS:write out filenames of files existing on a filesystem into afile)

2006-07-13 Thread Dave Gray
On 7/13/06, Chad Perrin <[EMAIL PROTECTED]> wrote: On Thu, Jul 13, 2006 at 01:44:40AM -0400, Mr. Shawn H. Corey wrote: > > It comes down to this, either he will post an apology for stating a > third party should not post his comments, or I'll leave this list, never > to return. 1. You may have

  1   2   >