Memory usage of var...

2001-09-04 Thread Brian
Is there any way to check how much memory a variable (hash, array, scalar) is using? I'm writing a program that deals with emails, and I need to keep the email in an array for use throughout the program. But, I'm not slurping it all at once (going line by line), which allows for me to check the

Re: Capture an email address from a text file

2001-09-04 Thread Ron Smith
I don't know how detailed you wanna get with this, but the following will return the line in the text file with the address. -snip-- #!/usr/bin/perl -w use strict; while (<>) { open (FILE, "some_file_name"); print if /@/; } close FILE; -sn

Re: Command line vs. Application

2001-09-04 Thread victor
Have you checked the permission, could it be your Application being run as somebody having no permission to write to the files you are trying to write to. or if you happens to make use of shell command within your script, the PATH variable could be missing from your application. Hope this help T

Command line vs. Application

2001-09-04 Thread Kim Green
I have a script that creates outputfile based on the rows returned from a select statement. I run the script from the command line, and the outputfile gets created. But, no file is created when I run the script from an application. Generally speaking, what kinds of things would cause this? Kim

RE: Using different versions of a module

2001-09-04 Thread Roland Praehofer
Thanks, I guess, I've used 'use lib' correctly. I tried to repeat the installation and did 'make test': ::: : Can't load './blib/arch/auto/GD/GD.so' for module GD: ./blib /arch/auto/GD/

Re: Finance::QuoteHist

2001-09-04 Thread John Bollinger
> You'll need to declare your variables with 'my', for the most part. > > my $q = ...; > > foreach my $row ($q->quotes) { > my ($date, $open, ...) = @$row; > } > > It looks -w compliant to me. Thanks, that works. I thought there might be more to it. I am used to making declarations s

Re: ONE MORE TIME

2001-09-04 Thread Randal L. Schwartz
> "Pedro" == Pedro A Reche Gallardo <[EMAIL PROTECTED]> writes: Pedro> Hi all, the script embodied in this e-mail is giving me the following Pedro> error message. Pedro> Use of implicit split to @_ is deprecated at ransep.pl line 20. Pedro> Use of implicit split to @_ is deprecated at rans

ONE MORE TIME

2001-09-04 Thread Pedro A Reche Gallardo
Hi all, the script embodied in this e-mail is giving me the following error message. Use of implicit split to @_ is deprecated at ransep.pl line 20. Use of implicit split to @_ is deprecated at ransep.pl line 23. Any idea what that thing means? The script in meant to to fire the submit bo

Re: securing sensitive information in CGI scripts

2001-09-04 Thread Brett W. McCoy
On Tue, 4 Sep 2001, Mel Matsuoka wrote: > Having password information embedded in a publicly accessible document such > as a CGI script is playing with fire, as far as I'm concerned. There may be > a time when you least expect it when someone (or you) screws up the > webserver config, and acciden

Re: Flush?

2001-09-04 Thread Brett W. McCoy
On Tue, 4 Sep 2001, John Way wrote: > I have been asked to see if perl writes to a filehandle directly > or if the data is buffered? If it is buffered, is there a command in perl > like the c command "flush"? Setting $| to true will turn on autoflushing -- your data buffer will get flushed afte

Flush?

2001-09-04 Thread John Way
I have been asked to see if perl writes to a filehandle directly or if the data is buffered? If it is buffered, is there a command in perl like the c command "flush"? Thanks, John Way Confidentiality Notice: *** Privileged/Confidential information

Re: Finance::QuoteHist

2001-09-04 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 4, John Bollinger said: >use Finance::QuoteHist; > $q = Finance::QuoteHist->new > ( > symbols=> [qw(LNUX MSFT IBM)], > start_date => '01/01/2000', > end_date => 'today', > ); > > print "Quotes:"; > foreach $row ($q->quotes()) { > ($date, $open,

Finance::QuoteHist

2001-09-04 Thread John Bollinger
The following script was presented in The Perl Journal 5.3. use Finance::QuoteHist; $q = Finance::QuoteHist->new ( symbols=> [qw(LNUX MSFT IBM)], start_date => '01/01/2000', end_date => 'today', ); print "Quotes:"; foreach $row ($q->quotes()) {

Re: Doing some text parsing

2001-09-04 Thread John Way
Christopher, You wrote... "The L in L54 would tell me what the data actually means, but the 54 is the part of that data I need to file based on the L it was attached too." Here is one way to do it... $test = "L54"; $pattern = "L"; if ($test =~/^$pattern/) { $test =~ s/^$pattern//; } print "$

RE: Doing some text parsing

2001-09-04 Thread Rob Dixon
Hi Christopher. Don't know about a WWW mirror, but here's my solution to your problem. my @data = qw(L54 L61 dKa dRz); foreach (@data) { my ($prefix, $value) = m/(.)(.+)/; print "Prefix: $prefix\n"; print "Value: $value\n"; print "\n"; } Sorry

RE: Doing some text parsing

2001-09-04 Thread Kaleb Murphy
for my $i(0 .. $#array) { my @data =~ split(//, $array[$i]); for my $j(0 .. $#data) { $data[$j];#This *should* be each character in that element of the first array. If someone has a better way to do this, please don't hesitate to correct me. } }

Doing some text parsing

2001-09-04 Thread Christopher Fisk
Hello, This is my first message to [EMAIL PROTECTED] so I'm not completely sure of the proper method of asking questions. First: Is there a web-based archive of this list? If So where? Second: I'm trying to parse some text for a decoding program. How would I decode something based on the firs

Re: regex: can't match pattern... dang

2001-09-04 Thread Michael Fowler
On Tue, Sep 04, 2001 at 10:10:39AM -0700, [EMAIL PROTECTED] wrote: > rootWed Aug 22 04:44:59 2001 DLs [snip] > for(@procs){ > /^(.{7})\s+?(.{24})\s+?(\S+?)$/; > > > I want $1 to be the user (e.g. 'root' 'postfix'). > I want $2 to be something like 'Wed Aug 23 05:30:01 2001'. > I want

Re: strict pragma and @ISA

2001-09-04 Thread Michael Fowler
On Tue, Sep 04, 2001 at 01:47:52PM +0100, [EMAIL PROTECTED] wrote: > if you are using perl 5.6 then u need to add a line > our qw( @ISA ) 'our' should only be used if you're using perl 5.6 and don't mind that the 'our' makes your code incompatible with earlier perl versions. 'our' should

RE: regex: can't match pattern... dang

2001-09-04 Thread Rob Dixon
John What you're doing looks OK, but it's my guess that either the user name doesn't start at the beginning of the line or the state doesn't finish at the end, i.e. you have leading or trailing spaces but have anchored your pattern to the ends of the string. Try foreach ( " ro

Re: Graphical interface

2001-09-04 Thread Michael Fowler
On Mon, Sep 03, 2001 at 12:15:07PM +0100, Dusan Juhas wrote: > are there any more perl graphical interfaces than Tk? Yes. Wx, Gtk, Qt, and X11::Toolkit, all available on CPAN. There may very well be others, but those are the ones I found on search.cpan.org in either the 'User Interfaces' sectio

Re: regex: can't match pattern... dang

2001-09-04 Thread Carl Rogers
Good day; I have the following strings: > rootWed Aug 22 04:44:59 2001 DLs >I want three things: > >user, the entire date, the state. What is separating these attributes? A constant number of spaces, or a tab? If so, it might be easier to use the "split" function. ($user, $date, $

RE: How to find the size of a JPEG

2001-09-04 Thread Rob Dixon
In a similar way, a GIF file has either 'GIF87a' or 'GIF89a' the first six bytes (depending whether it's the 1987 or the 1989 standard) followed by the screen width (in pixels) in the next two bytes, followed by the screen height in the two after that. Cheers, Rob > -Original Message-

Re: regex: can't match pattern... dang

2001-09-04 Thread John Way
This worked fine for me! $_ = "nobody Wed Aug 22 12:32:22 2001 I"; print "$_\n"; $_ =~ s/^(.{7})\s+?(.{24})\s+?(\S+)$/$1,$2,$3/; print "User = $1\n"; print "Date = $2\n"; print "State = $3\n"; John Way

regex: can't match pattern... dang

2001-09-04 Thread GoodleafJ
I posted a similar question last week; this is a rephrasing. I have the following strings: rootWed Aug 22 04:44:59 2001 DLs rootWed Aug 22 04:44:59 2001 ILs rootWed Aug 22 04:44:59 2001 DL rootWed Aug 22 04:44:59 2001 DL rootWed Aug 22 04:44:59 2001 D

How to find the size of a JPEG

2001-09-04 Thread Nigel Wetters
I've been disecting the CPAN Image::Size module, and have found out some useful stuff that I wanted to share. The beginners list seemed an appropriate place. Here's the algorithm for finding the height and width of a JPEG (all nambers are hex): 1. Skip the first two bytes of the file. 2. Read t

RE: Use of uninitialized value in concatenation (.) or string at mlknpvs.pm line 241

2001-09-04 Thread Rob Dixon
Hi John I think you need to tell us something more. You say you my @parts = ("one", "two", "three"); substr($parts[1],0,0) = "."; print "@parts"; works fine. (Unless you really /did/ miss the closing quote from 'three'?). May we see a little more of your code? Don't forget that, i

Capture an email address from a text file

2001-09-04 Thread Arthur Perley
Hello, I need some suggestions regarding stripping email addresses from returned email messages. The addresses are embedded in text files (the email message) without any consistent delimiters (e.g. < or :). These aren't the "From:" addresses, since that is usually something like [EMAIL PROTECTED]

Use of uninitialized value in concatenation (.) or string at mlknpvs.pmline 241

2001-09-04 Thread John Way
I am running a script with -w and I keep getting multiple warnings like... Use of uninitialized value in substr at mlknpvs.pm line 240 Use of uninitialized value in concatenation (.) or string at mlknpvs.pm line 241 In this particular script I call a sub from mlknpvs.pm. I declared an

Re: strict pragma and @ISA

2001-09-04 Thread register
Sorry u r right ... have not really made the mental switch to use 'our' yet ... thanks for pointing it out .. On Tue, Sep 04, 2001 at 10:35:05AM -0400, Bob Showalter shaped the electrons to read: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Tuesda

RE: Bind variables

2001-09-04 Thread Bob Showalter
> -Original Message- > From: Kim Green [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 10:13 AM > To: '[EMAIL PROTECTED]' > Subject: FW: Bind variables > > > > > My script has a statement handle that accepts only one > parameter. I am > > assigning the parameter given to

RE: strict pragma and @ISA

2001-09-04 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 8:48 AM > To: Ruth Albocher > Cc: [EMAIL PROTECTED] > Subject: Re: strict pragma and @ISA > > > if you are using perl 5.6 then u need to add a line > our qw( @ISA ) No, t

RE: Killing a deamon

2001-09-04 Thread Bob Showalter
> -Original Message- > From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 1:32 AM > To: [EMAIL PROTECTED] > Subject: Killing a deamon > > > List, > > Is there a quiker way to restart a perl daemon in UNIX rather than > having to do a kill -9 PID then

FW: Bind variables

2001-09-04 Thread Kim Green
> My script has a statement handle that accepts only one parameter. I am > assigning the parameter given to the $ARGV[0]. I run the script from the > command line, also sending the parameter. I am also assigning all selected > values to an array for output. > I continue to get this message: > Ca

RE: Using different versions of a module

2001-09-04 Thread Bob Showalter
> -Original Message- > From: Roland Praehofer [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 03, 2001 9:12 AM > To: [EMAIL PROTECTED] > Subject: Using different versions of a module > > > Hi, > > I'd like to use a newer version of the GD module > Is it possible to have two version

RE: cron, perl and iTunes

2001-09-04 Thread Bob Showalter
> -Original Message- > From: Chris Garaffa [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 04, 2001 12:12 AM > To: [EMAIL PROTECTED] > Subject: cron, perl and iTunes > > > Hey everyone, > Here's a question concerning Apple's iTunes, cron, and tying them > together with perl. > >

Access Denied When Trying to Create Directory?

2001-09-04 Thread David Simcik
Hey all, I'm simply trying to create a directory on a mapped (remote) drive from a CGI script using the mkdir() function. I keep on getting "Access Denied" errors or the like every time I try to create a new directory. What do I need to do to assign the proper rights to my script so it can

Re: Validate the regex

2001-09-04 Thread Jeff 'japhy/Marillion' Pinyan
On Sep 4, neeraj arora said: >Is there anything using which i can validate that the regex i input is >valid or not. The simplest way is to try and use it: eval { "" =~ $regex }; if ($@) { # bad regex } -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~j

RE: Validate the regex

2001-09-04 Thread Gibbs Tanton - tgibbs
You can also wrap it in an eval block and match an empty string to it. my $regex = <>; eval { '' =~ /$regex/; } die "Bad Regex!" if( $@ ); -Original Message- From: Karthik Krishnamurthy To: [EMAIL PROTECTED] Sent: 9/4/2001 7:46 AM Subject: Re: Validate the regex regex itself. use re

Re: Validate the regex

2001-09-04 Thread Karthik Krishnamurthy
regex itself. use regular expressions to check for validity /kk On Tue, Sep 04, 2001 at 05:26:05PM -0400, neeraj arora wrote: > Hey > i am writing a piece of code that reads a regex and matches it with a > file name. > Is there anything using which i can validate that the regex i input is > vali

Re: strict pragma and @ISA

2001-09-04 Thread register
if you are using perl 5.6 then u need to add a line our qw( @ISA ) if you r using perl 5.5 u ned to add a line use vars qw( @ISA ) btw this applies to a lot of global variables like $VERSION $AUTOLOAD etc ... On Tue, Sep 04, 2001 at 03:10:32PM +0200, Ruth Albocher shaped the ele

Re: strict pragma and @ISA

2001-09-04 Thread Jos I. Boumans
something like this would be good praxis: BEGIN use vars qw(@ISA @EXPORT_OK); @ISA = qw(Exporter OtherModule); @EXPORT_OK = qw(some_function); } damian's book is definately worth your while if you're into OO programming btw: "Object Orientated Perl" by Damian Conway Published b

strict pragma and @ISA

2001-09-04 Thread Ruth Albocher
hi all. I am trying to use the strict pragma in all my perl files, but when i use it with @ISA I get: Global symbol "@ISA" requires explicit package name at ...pm line .. like any other variable that should be declared. I understand that @ISA is not local, but this is how it is put in all the ex

having two versions of perl possible?

2001-09-04 Thread Alexander Bjelke
At work I only have access to Perl v. 4 which seems very different from Perl v. 5 which I have used before. Is it painless to install Perl 5 without modifing the Perl 4 version? Is it OK to just install it another place than where Perl 4 is? It is very important that I don't in any way interfere

Re: Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread Jos I. Boumans
you need to send it a reference to a hash rather then an array then hth Jos - Original Message - From: "Veeraraju_Mareddi" <[EMAIL PROTECTED]> To: "Jos I. Boumans" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, September 04, 2001 11:48 AM Subject: RE: Getting a list of USERS

RE: Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread John Edwards
>From the Lanman docs... NetUserGetInfo($server, $user, \%info) Retrieves information about user testuser on server \\testserver. if(!Win32::Lanman::NetUserGetInfo("testserver", "testuser", \%info)) { print "Sorry, something went wrong; error: "; # get the error code

RE: Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread Veeraraju_Mareddi
I want to get Full name of the User --- use Win32::Lanman; if(!Win32::Lanman::NetGroupGetUsers("hotnt001", "Webusers", \@users)) {

Validate the regex

2001-09-04 Thread neeraj arora
Hey i am writing a piece of code that reads a regex and matches it with a file name. Is there anything using which i can validate that the regex i input is valid or not. eg *.gif is not a valid regex so i want to discard that thanks in advance neeraj -- To unsubscribe, e-mail: [EMAIL PROTECT

RE: Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread John Edwards
I prefer Win32::Lanman myself. More comprehensive. You can grab the latest binaries from Dave Roth's FTP site. ftp://ftp.roth.net/pub/ntperl/Others/Lanman HTH John -Original Message- From: Jos I. Boumans [mailto:[EMAIL PROTECTED]] Sent: 04 September 2001 08:37 To: Veeraraju_Mareddi; [E

Re:File Parser

2001-09-04 Thread Jorge Goncalvez
Hi, I tried to make a parser to display some information in labels widgets written in Perl TK. My file is cygwin_syslog.txt and my code is: my ($f)=@_; $thistime=(stat($f))[9]; return if ($thistime == $mtime); $mtime=$thistime; my

Re: Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread Jos I. Boumans
coincidently, i had to do the same thing yesterday... i used Win32::AdminMisc module, which you can obtain from www.roth.net the docu is good, so it should all explain itself from there. if your'e still stuck after installing, msg me, i'll send you some sample code. regards, Jos - Origina

Re: References? (fwd)

2001-09-04 Thread Pradeep Reddy
hi Bert de Jong, Basically references are like pointers in C (of course there are subtle differences). eg .In perl. |In C (int var , *ptr); $variable = "hello world";|var = 12345; $reference = \$variable|ptr

Re: References?

2001-09-04 Thread Jos I. Boumans
http://japh.nu/index.cgi?base=references a basic reference tutorial =) hope that helps, Jos - Original Message - From: "Bert de Jong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 04, 2001 9:08 AM Subject: References? Hi all, I'm reading a beginners tutorial o

Getting a list of USERS from an NT USER GROUP

2001-09-04 Thread Veeraraju_Mareddi
Dear Beginners, I have a small task of getting NT user list from a NT USER GROUP. Please suggest me.. Thanking you With Regards Rajuveera -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]