RE: tempfile

2004-04-06 Thread Bob Showalter
WC -Sx- Jones wrote: > Christian Stalp wrote: > > Hello together, > > I want to create a tempfile via the function tempfile. > > But I want a certain path and name for the file. > > The option DIR and SUFFIX and s.o. is clear to me but how can I > > set the name of the file? For Exam: temp_file.lo

RE: use MD5

2004-04-06 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > All, > > can anyone advise? > I have MD5 config'ed and compiled and it is in my PATH variable. How did you install MD5? If you installed it using the standard method, it should be in the proper location. PATH is irrelevant to Perl module searches. Also, you should use

RE: [OT] last day of a month

2004-04-06 Thread Bob Showalter
NYIMI Jose (BMB) wrote: > Hello, > > How to get the last day of a month using a korn shell command ? > So far I found the following : > > > echo `cal 12 2004` | awk '{print $NF}' > > Do you have alternative ? I think that one's pretty clever. How about the similar: set `cal 12 2004` && eval

RE: [OT] last day of a month

2004-04-06 Thread Bob Showalter
Bob Showalter wrote: > set `cal 12 2004` && eval echo \${$#} here's a simpler one that doesn't zap your parameters: : $(cal 12 2004) && echo $_ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.p

RE: An extremely newbie question about appending records in a fil e.

2004-04-07 Thread Bob Showalter
Weaver, Walt wrote: > Okay, so I do a "perl -pi -e 's/$/;/g' " to try and append a > semicolon to the end of each record in a file in Linux. > > It does that just fine. Unfortunately it also prepends a semicolon > onto the beginning of each record too. Well, not exactly. Note that there's no semi

RE: installing perl module without root permission

2004-04-13 Thread Bob Showalter
gohaku wrote: > On Apr 9, 2004, at 6:27 AM, Randal L. Schwartz wrote: > > > Yes, and the instructions are included with your copy of Perl, > > in "perldoc perlmodinstall". > > What if perldoc is not included for some reason? perldoc may be installed, but not in your PATH. Perl comes with a numbe

RE: Where do you put your modules?

2004-04-13 Thread Bob Showalter
Kevin Old wrote: > Hello everyone, > > I've written several subroutines that are useful to me, but not useful > enough to package into separate modules and publish on CPAN. I put > them in a module call KOBagOTrix.pm and just use a "use lib" > statement to point to that module on my hard drive. >

RE: untaint path

2004-04-15 Thread Bob Showalter
Angie Ahl wrote: > Hi Gary > > That was it. so using the result of a regex test gets around it.. > That's a wise practice. You should read over "perldoc perlsec". It explains how this works: "The only way to bypass the tainting mechanism is by referencing subpatterns from a regular expres

RE: What has been installed

2004-04-15 Thread Bob Showalter
Harter, Douglas wrote: > When you install a Perl module, it is documented in a file. (I know > this because I remember seeing it when I installed modules.) However, > I have not installed any modules for a good while and forgot what the > file name is. > > I would like to find out what extra mo

RE: why $a became 6 ?

2004-04-15 Thread Bob Showalter
John W. Krahn wrote: > Or: > > ( $a = 3 and $b = 6 ) if ( 1 == 1 ); or if he intends both assignments to be made together: $a = 3, $b = 6 if 1 == 1; This will set $b to 6 even if $a is set to a false value, which the prior methods won't do. This may or may not be what the OP is after... --

RE: Test For Dupplicate elements in an array

2004-04-20 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I need to test if an array holds duplicates, and if so do something. If you just need to check for the presence of a duplicate, something like this will do the trick: sub has_dup { my %seen; $seen{$_}++ && return 1 for @_; } Of course, all the hash-based methods depe

RE: creating a hash out of 2 arrays

2004-04-20 Thread Bob Showalter
Sanyal, Dibya F (Corporate, consultant) wrote: > Hi, > > I have 2 arrays. One holds all uniq key values of an associative list > (all ssn), other holds the associated values (their names). I need to > create a hash by putting these arrays together. Each entry in that > hash would be (ssn => name).

RE: Please help!

2004-04-20 Thread Bob Showalter
Jason Dusek wrote: > I have code that looks like this: > ... > my $funk = '/home/jdd/sbin/idlwave2outline.pl'; > my $jam = '/home/jdd/sbin/outline2html.pl -p -t'; > my $web_dir = '/home/jdd/www'; > ... > sub makedocs { > $code = $File::Find::name; > $name = $web_dir.'/'.$_; > system(

RE: removing duplicate array values

2004-04-21 Thread Bob Showalter
Peterson, Darren - Contractor.Westar wrote: > I'd like to remove duplicate values from an array to leave it with > only unique values. For instance, if an array contains > (1,2,3,1,4,2,5) as values, I'd like to clean out the extra 1 and 2 to > leave the values as (1,2,3,4,5). Does perl have an ar

RE: removing duplicate array values

2004-04-21 Thread Bob Showalter
Jeff 'japhy' Pinyan wrote: > On Apr 21, Bob Showalter said: > > There's a Tie::Array::Unique module on CPAN which gives you a lot > > more flexibility in handling this kind of thing. > > I agree (says the author of the module). It maintains the uniqueness &g

RE: Reading rss formated sources.

2004-04-21 Thread Bob Showalter
Thomas Williams wrote: > I am trying to build a cgi script that parses RSS files. > > RSS is the name given to a simple and well-established XML format > used to syndicate headlines. XML::RSS on CPAN helps with this. It comes with an example you can use as a basis for your script. http://search.

RE: Reading rss formated sources.

2004-04-22 Thread Bob Showalter
Thomas Williams wrote: > Thanks, but I meant that I am look for advise on reading rss files! My advice is to use XML::RSS. How does that not answer your question? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: printing pod

2004-04-23 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I would like to be able to print pod sections to the screen, like > have an option to print out my revision history. I'm sure there must > be an easy way to handle thisbut how? The Pod::Usage module comes close to doing what you want; perhaps you can adapt it to you

RE: Perl::Optomizer

2004-05-13 Thread Bob Showalter
JupiterHost.Net wrote: > Hello list, > > Perl::Tidy is very excellent for making source look nice. > I was wondering if anyone knew of anything that is the same type of > idea but it optomizes your Perl code to run a bit faster: > for instance: > $newvariable = "$howdy"; > should be: >

RE: Extracting attachment from mail

2004-05-13 Thread Bob Showalter
NYIMI Jose (BMB) wrote: > I need to write a perl script that will run on solaris and the job of > this script will be : > > - read a mail from a predefined shared mail box (Outlook/Exchange > Server) Mail::IMAPClient or Mail::POP3Client > - extract the mail attachment (text file) > - parse the

RE: date manipulation mods

2004-05-13 Thread Bob Showalter
Harry Putnam wrote: > Group, > > Is there a date manipulation module that does the same thing as gnu > `date -d' command? That is, given a spec string, it returns a date in > the past in user selected format. > > Like what gnu `date' would do with: > date -d '-2 weeks' +"%m%d%Y_%T" > 042920

RE: process signals

2004-05-07 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I have an application system command that is like tail -f in UNIX and > I want to say > > x=1 > while x < 10 > do > 'command' append to log > print "\n" append to log > issue HANGUP or KILL SIGNAL > x+=1 > done > > How do I issue a hangu

RE: process signals

2004-05-07 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > If you dont understand my question then I assume you do not know unix > or tail -f ? You're right, those are both new to me. > I want to after a sleep of 5-8 seconds, send a kill > signal to the previous command then increment the counter. thank > you! Sorry, I think

RE: Controlling bottom posting in outlook

2004-04-26 Thread Bob Showalter
Price, Jason (TLR Corp) wrote: > ... Is > there a utility available that would allow me to bottom post only on > messages I choose? A right click option for bottom posting would be > ideal - anyone know of a utility that can do this? Outlook-QuoteFix can be configured to only reformat wh

RE: perl mysql question

2004-04-27 Thread Bob Showalter
Christopher Lyon wrote: > Not sure if I should post this to beginners or not but there it goes. > > I have 10+ tables with some of the same information in each in table > of a mysql database. Here is an example: > [snip] > > I need to take the names and add the counts up for between each table >

RE: Looking for a equivalant function in Perl for main(int argc, char *argv[ ])

2004-04-28 Thread Bob Showalter
Shilpa Arvind wrote: > Hi, > > In C programming language we have a function which looks like this: > > main(int argc, char *argv[ ]). > > Is there a equivalant function in Perl. I was looking at @ARGV but i > feel it does not behave the same way as the above function does. I > might be wrong.

RE: Problem when use split

2004-04-29 Thread Bob Showalter
John Doe wrote: > ... > When i run script i recive error: > # ./check-size.pl > > bad interpreter: No such file or directory This can be caused by the file containing DOS-style line endings. If the first line is: #!/usr/bin/perl the kernel will include the as part of the file name and try to

RE: Simple DBI question

2004-05-05 Thread Bob Showalter
McMahon, Chris wrote: > Can anyone suggest DBI syntax to capture the result of > > SELECT DISTINCT column1 FROM table WHERE column2= -1 > > into an array? Just a hint would help... my @results = $dbh->selectcol_array('select ...'); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: How do I append text to a text file - in the 3rd row ?

2004-05-05 Thread Bob Showalter
Aviram, Shy wrote: > Hi, > > I have a text file I open and want to add new text into. However, I > want the new text to be at the 3rd row of the file (below the > headline) and not at the end. Use Tie::File. Super simple. http://search.cpan.org/~mjd/Tie-File-0.96/ -- To unsubscribe, e-mail: [E

RE: Running two process simultaneously

2004-05-05 Thread Bob Showalter
William Black wrote: > How can you run two processes Simultaneously in Perl? perldoc -f fork What are you trying to do? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Running two process simultaneously

2004-05-05 Thread Bob Showalter
[ stay on-list please, and bottom-post please ] William Black wrote: > I have two perl scripts that need to be run at the same time. > > x.pl > y.pl > > How is this done? You can use a shell to start them both: $ perl x.pl &; perl y.pl & Or, one can fork() and exec() the other: x.pl

RE: Problem with use strict;

2004-05-14 Thread Bob Showalter
MCMULLIN, NANCY wrote: > Hi there. > Brand new to PERL so please bear with me. (I'm running Win32/Apache) Hi. It's "Perl", not "PERL". You're excused since you're brand new :~) > > When I include the line > use strict; > in any perl program, I get the following error: > "Internal Server Error

RE: Find closest value

2004-05-17 Thread Bob Showalter
Mike Blezien wrote: > Hello, > > is it possible, with perl, to find the closest numerical value to a > set value. IE. a set value of 15 and I have five values, > 208,258,56,123 > > is there a function too go through the five values array to find the > closest to 15 ?? Here's an approach that do

RE: working directory with exec command

2004-05-18 Thread Bob Showalter
Peterson, Darren - Contractor.Westar wrote: > I'm trying to use fork and exec to kick-start other processes on a > Linux box. As with Win32::Process::Create, I'd like to somehow > specify or point towards a working directory for the new process > since some data files are expected via relative pat

RE: using Sleep instead of Cron

2004-05-18 Thread Bob Showalter
Wiggins d Anconia wrote: > cron can be installed as part of the Cygwin distro, not sure about > other ways. The M$ products come with a scheduler as well, but you > have now exhausted my knowledge of it ;-) The MS "at" service blows huge chunks. There is a cron for Windows at http://cronw.so

RE: Perl Newbie Question

2004-05-18 Thread Bob Showalter
Perl Mail User wrote: > Hello All, Hi. Providing a real name would be considered polite. Also, please choose a meaningful subject. > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part > of > the script

RE: @UNIQUE=unique(@REDUNDANT);

2004-05-19 Thread Bob Showalter
Randy W. Sims wrote: > How would you implement a version of the function that > produced an array where the elements are in the same order and only > the first of any duplicates are kept? @uniq = do { my %seen; grep !$seen{$_}++, @arr }; Or, if you want a function: sub uniq { my %seen; gre

RE: Installation Problem -- Text::CSV

2004-05-19 Thread Bob Showalter
Jeff Westman wrote: > Hi All, > > I am running Active Perl 5.8.0, and installed CSV.pm into > c:\perl\lib\text. When I run the test.pl file with it I get > > C:\> perl test.pl > 1..20 > Can't locate auto/Text/CSV/autosplit.ix in @INC (@INC contains: > C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/l

RE: perl / unixODBC and Oracle 9i

2004-05-19 Thread Bob Showalter
Johnson, Shaunn wrote: > Howdy: > > I'm running Perl 5.8.x on RHEL ver. 3 and I am > trying to connect to Oracle 9i (both > the database and the Application Server's > repository). > > With Perl 5.6.1, I used DBI and Oracle:DBD > and things worked well, with Perl 5.8.x, the > readme docs for the

RE: DBM Files

2004-05-20 Thread Bob Showalter
BOLCATO CHRIS (esm1cmb) wrote: > Hello all, > I am fairly new to using Perl and have some questions regarding DBM > Files. The answer to a lot of these questions will be "it depends". It depends on what you're trying to do. > One, which type is recommended DB_File, GDBM, SDBM, NDBM etc.? In gen

RE: HTTP

2004-05-27 Thread Bob Showalter
Ramprasad A Padmanabhan wrote: > Are your sure you want to write your own in perl, then you would have > to use LWP or similar modules from CPAN > > But If you want straight download , why dont you just use tools like > "lynx -source" or "wget" or "snarf" Or lwp-download -- To unsubscribe, e-ma

RE: Module help (local variables in seperate directory)

2004-06-03 Thread Bob Showalter
Andrew Koebrick wrote: > I am having trouble creating a modules which splits its functions and > variables between two files in two separate directories. > > I want to have a set of global functions (i.e. open database > connection...) which would live in the main Perl path, and a local > configu

RE: using Mail::Sendmail

2004-06-03 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I was looking at the Mail::Sendmail module from CPAN and I did not > find anything that showed printing a body. How do I print a body of > text data from a variable? I haven't used Mail::Sendmail, but it looks like the message body goes in the Message entry of the hash

RE: Calling "more" in perl script for large files.

2004-06-04 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi There, > Any pointers to how to call "more" on a file in perl script. > I am writing one script which displays one report to user and then > asks some inputs. > > User need to see complete file. To solve this, I thought I can call > `more in the script and continue.

RE: mime lite

2004-06-04 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Does anyone see anything logically wrong with my code b/c I am still > not receiving the correct data in the email. The data is a # 1 when > it should be a listing of Ex strings. [snip] > Data=> print "@ftapes" ); This is assigning the

RE: different versions of same Perl module in different Apache vh osts

2004-06-07 Thread Bob Showalter
Andrew Gaffney wrote: > I didn't really know where to post this since it isn't specifically > Apache or Perl, so I'm posting herejust because :) > > I run 2 vhosts under Apache 1.3.29 (needed for mod_perl-1.x which is > needed by HTML::Mason) on my Gentoo server. One vhost is the current > pro

RE: different versions of same Perl module in different Apache vh osts

2004-06-07 Thread Bob Showalter
Andrew Gaffney wrote: > I will end up having more than 2 vhosts, most of which will need a > custom version of this particular module. In that case, I think you'll need to give the modules different names. You could write your handler in such a way that it would recompile the module (switching fla

RE: if -s clause

2004-06-08 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I have tried all three methods if -s OUT, if -f $filename and if > -s @arrayname with no evail. > I did make a test.pl file so that I am just testing whether the file > is greater than 0 bytes. Here is the code. > autoflush is turned on. Is this the correct spot

RE: if -s clause

2004-06-08 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > ok so here is what I did and it is now working. > > one thing I do not fully understand is the diff between > my $svsel = select; select OUT ; $|=1; > and > select (select(OUT), $| = 1 ) [0] ); > > the second line works while the first does not and > from my understandi

RE: save output as text file, move file to another location

2004-06-09 Thread Bob Showalter
Gregg O'Donnell wrote: > Greetings all! I have data that is output from a form. OK. I assume you mean an HTML form and your script is a CGI script. > How do I take > this data, save it as a .txt file, and place this .txt file in > another location (a different folder, not cgi-bin) on my server?

RE: Importing external data into arrays

2004-06-09 Thread Bob Showalter
Roberto Etcheverry wrote: > chomp for @array; # trim "\n" at the end or chomp(@array); or even chomp(my @array = ); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: What the 'FETCH' is up with Perl?

2004-06-10 Thread Bob Showalter
jason corbett wrote: > Hello all. Can someone tell me what is the difference in the various > ways to FETCH data from a database? I bought like 3 books and they > don't really go in depth with the reasons why there are several of > them, and what happens if you interchange them with different > sce

RE: Very wierd problem with CGI.pm

2004-06-11 Thread Bob Showalter
mike wrote: > Has anyone ever come accross this wied problem before > > I have a script which pulls records from a DB then loops into a form > and shows each record, with the id no being concatenated to the field > name to give a unique record id. > > However if I have this > "Banked",textfield(-

RE: SQL PLUS

2004-06-11 Thread Bob Showalter
jason corbett wrote: > What would I need to call SQL Plus into action for PERL? If you just need to execute SQL statements, use the DBI module and talk directly to the database. If you need to run existing sqlplus reports, use any of the standard facilities like system(), backticks, pipe open, fo

RE: Perl newbie: regexp

2004-06-17 Thread Bob Showalter
raj wrote: > Hello All, >I am new to perl. I want to display the lines which > have "Testing" word. I have to do this in command line. > > I tried the with following options. Its not work what I expected. It > dispalys all lines. > > perl -p -e 'print if /Testing/m' test.txt -p s

RE: perl help

2004-06-17 Thread Bob Showalter
jack jack wrote: > Hi All, Hi. Use a meaningful subject. "perl help" is a given on this list. > > > I have 2 variables $last_accessed and $owner_line > $last_accessed=": Last accessed 20-Apr-04.12:57:30 by > [EMAIL PROTECTED]"; > $owner_line="Owner: opc_bld : rwx (all)"; > > -From $l

RE: printing array elements in columns

2004-06-18 Thread Bob Showalter
N, Guruguhan (GEAE, Foreign National, EACOE) wrote: > Hi All, > I have a one dimensional array @X, containing N elements. I > would like to know how I can print this N elements in M columns? If you want the data to read across, then down, you can do: @X = 'A' .. 'Z'; $m = 8; p

RE: VARIABLES

2004-06-18 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > All, > > Does perl have built in variable names such as in awk? Yes, it has many of the same. They are documented in perldoc perlvar. They have short names like $/, $", etc. There is a standard module called English.pm that aliases them to longer names more like the aw

RE: Why are timelocal() and localtime() not exactly opposite?

2004-06-21 Thread Bob Showalter
Zeus Odin wrote: > ... > # localtime cannot handle year 1903, but timelocal can Short answer is that the epoch started in 1970, so 1903 is "out of range" for the purposes of localtime(). Don't use epoch seconds for storing historical dates like birth dates, etc. -- To unsubscribe, e-mail: [EMAI

RE: pattern matching

2004-06-23 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hi, > > I have a string similar to: > Comment: FILING > --- - > > This is read in as one line (with the page feed). > I was trying to whatever follows the words and I tried this. Trying to rem

RE: Timer in Perl??

2004-06-24 Thread Bob Showalter
William Martell wrote: > Hello Group, > > Could anyone please tell me if there is a timer function in Perl. I > am trying to get some perl code to run every morning, but I am unsure > how to do it. What platform? On Unix, you typically use cron to run jobs at scheduled times. Windows has a sched

RE: Printing hash of hashes

2004-06-24 Thread Bob Showalter
Daniel Falkenberg wrote: > Hello All, > > I need to print my hash of hashes. For example... > > %HoH = ( > flintstones => { > lead => "fred", > pal => "barney", > }, > jetsons => { > lead => "george", >

RE: Printing hash of hashes

2004-06-25 Thread Bob Showalter
LRMK wrote: > if ($hash{$k} =~ m/=HASH/){ if (ref($hash{$k}) eq 'HASH') { perldoc -f ref -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: A possibly stupid 'Perl' question?

2004-06-25 Thread Bob Showalter
Ron Smith wrote: > ... I only have access to > 'Windows' machines that do not have Perl installed at all. > Is there a way to use Perl on-line from such a machine? Go to http://www.activestate.com/Products/ActivePerl/ and install ActivePerl (free). > Is Perl small enough to > be installed on a fl

RE: matching only digits

2004-06-28 Thread Bob Showalter
N, Guruguhan (GEAE, Foreign National, EACOE) wrote: > Hi All, > I wanted to check whether the user input is only a number > and does contain any alphabet/s anywhere i.e. starting, end or > in-between. Can somebody tell me how to do this? I assume you mean "does NOT contain any ..." chom

RE: string seperated by multiple spaces

2004-06-28 Thread Bob Showalter
Naser Ali wrote: > I used "\s*" in split, so I do not have worry about counting the > spaces or tabs between each field I noticed something in the OP that didn't really get addressed: \s* will match an empty string, which will split into a list of single characters. $ perl -le 'print for spli

RE: Extracting fields from a data file

2004-06-29 Thread Bob Showalter
mohammed chafik wrote: > Hi all, > > I have input file like this: > > header, 06-12-2004, path, > /usr/bin/sh,attribute,100555,root,other,315,565690, > subject,bscs,sgrp,9936,6785,0 0,return,success,0 (line1) > ... > I nee

RE: Installing a module when you have limited permissions

2004-06-29 Thread Bob Showalter
jason corbett wrote: > Hello. I wanted to know if someone has installed a PERL module on a > server where they had limitied permissions? I am not extremely UNIX > savy but I do know the basic and know the something about the file > structures, etc. Can someone tell me how I can install MIME::Lite o

RE: ways to change the first char from a filename (with full path )

2004-06-29 Thread Bob Showalter
Rod Za wrote: > Hi all, > > i'm trying to make a code that get a file name (with full path) and > change the first char of the filename. Someone can say me if there's > a better way to do this?: > > _BEGIN_ > #!/usr/bin/perl -w use strict; > my($file) = $ARGV[0]; #receives th

RE: Help on permissions for CGI

2004-06-29 Thread Bob Showalter
WEBMASTER wrote: > Hello everybody. Hi. Real names appreciated. > > I am on a new server and have discovered the Directories in the > CGI-BIN are visible to everybody. This is, if a type > www.mysite.com/cgi-bin I get a list of all the files and > subdirectories, and so for every subdirectory.

RE: :Socket

2004-07-01 Thread Bob Showalter
Werner Otto wrote: > Hi All, > > I have the following problem. > > _Code:_ > #!/usr/bin/perl > use IO::Socket; > > my $host=shift @ARGV or die 'need hostname'; > my $port=shift @ARGV or die 'need port number'; > my $timeout=1; > my $socket=IO::Socket::INET->new(PeerAddr=> $host, > PeerPo

RE: :Socket

2004-07-01 Thread Bob Showalter
Werner Otto wrote: Keep the discussion on the list please. > Bob Showalter wrote: > > ... > > What platform and what version of Perl and IO::Socket? If I fix the > > missing comma, it times out properly for me with Perl 5.6.1 on > > FreeBSD 4.10 > > > SunOS

RE: :Socket for http download

2004-07-01 Thread Bob Showalter
Ramprasad A Padmanabhan wrote: > I want to write a basic http download ( text/binary) script using > IO::Socket. Does anyone have any examples anywhere. > > > I know ,everyone must be wondering why I cant use ready modules like > LWP. > Well I want to auto transfer files to different remote machi

RE: Tie::DBI

2004-07-02 Thread Bob Showalter
David Arnold wrote: > All, > > Never mind. It was a permissions problem. I downloaded the gz file, > unzipped and untarred and read the installation directions and found > the problem. For future reference, you can issue the look command from the CPAN shell: $ perl -MCPAN -e shell cpan> lo

RE: unique array

2004-07-02 Thread Bob Showalter
perl.org wrote: > From http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch04_07.htm, Methinks that stuff is illegally posted copyrighted information. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: unique array

2004-07-02 Thread Bob Showalter
perl.org wrote: > On Fri, 2 Jul 2004 14:32:49 -0400 , Bob Showalter wrote > > perl.org wrote: > > > From http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch04_07.htm, > > > > Methinks that stuff is illegally posted copyrighted information. > > Several people

RE: make perl scripts in to .exe and a services

2004-07-06 Thread Bob Showalter
Thomas Browner wrote: > Is there away to make a perl scripts in to a .exe and a services for > free. -- For making Windows services, see Win32::Daemon and Win32::Daemon::Simple on CPAN. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: multiple inheritance

2004-07-06 Thread Bob Showalter
perl.org wrote: > I have a vendor-provided OO package and a custom OO package. The > custom package does not need a constructor. I want to have a class > that inherits from both. It also does not need a constructor - it > should use the constructor from the vendor-provided package. > > I have a

RE: Split the line with "|" character

2004-07-07 Thread Bob Showalter
Wil wrote: > @data = split ("\|",$line); The double quotes are eating the backslash before split sees it. split() treats the first arg as a regex (even if you pass it as a string), and the pipe char needs to be escaped with a backslash in order to be treated as a literal character. What you'

RE: Trying to locate module in parallel directory

2004-07-07 Thread Bob Showalter
Ron Goral wrote: > Greetings - > > I am having trouble locating and using modules that are not in the > current directory of a cgi script. For this test, I know the > directory structure looks like this: > > cgi-bin/test/test.cgi > cgi-bin/lib/DGStanLib.pm Why not the straightforward: u

RE: ${DBI::errstr} vs $DBI::errstr

2004-07-08 Thread Bob Showalter
perl.org wrote: > If my Perl contains ${DBI::errstr} I get warnings like this: > > Ambiguous use of ${DBI::errstr} resolved to $DBI::errstr at (eval 20) > line 284. > > If my Perl contains $DBI::errstr (without the braces) I don't get > these warnings. Is there an explanation for this? When Pe

RE: Determine if sub exists in module

2004-07-08 Thread Bob Showalter
perl.org wrote: > I can probably figure this out if I spend some time but as I was > going through it more questions were raised. > > Is it possible for a Perl script to check if a subroutine exists in a > module without actually invoking that subroutine? Not really, because of autoloading. See p

RE: trim

2004-07-08 Thread Bob Showalter
John wrote: > Is there any trim function that trims the spaces before and the end > of the string? There's probably a module somewhere with such a function. You can also write one simply. I usually use the following: s/^\s+//, s/\s+$// for $variable; I like that form because you can list a

RE: @ARGV - override

2004-07-08 Thread Bob Showalter
Brian Volk wrote: > Hi All, > > I have a directory full of .txt files that I need to send to > Regexp::Common... I want to over ride the diamond operator by > defining the directory using @ARGV . I'm not sure how I define > it.. Please help, w/o too much laughing! :-) > > -

RE: Use of uninitialized value in string eq

2004-07-09 Thread Bob Showalter
FyD wrote: > Hi, > > Here is a short perl script: > >open (FILE, "<$START"); First of all, we ALWAYS recommend you put "use strict" at the top of your program and delcare your variables with "my". That can save you from lots of trouble with typos, etc. Also, always check the return value fro

RE: Request to help beautify a Perl-based menu script

2004-07-09 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Hello, > > This is the current state of my text-based Perl "menu" script. It > pretty much does everything I want with the exception of colors (two > of my highly influential users want colors). I will therefore > appreciate any help or pointers. Use Curses.pm for stu

RE: Help with "use"

2004-07-09 Thread Bob Showalter
BOLCATO CHRIS (esm1cmb) wrote: > Hello all, > Can "use" be used in a sub routine that is kept external? Yes. > Ex. > Program 1. > > #!/bin/perl > require '/home/users/me/foo.pl'; > exit; > > > Foo.pl > > sub bar { > use strict; > use fcntl; > use AnyDBM_File; > } This would not be a typical

RE: Help with "use"

2004-07-09 Thread Bob Showalter
BOLCATO CHRIS (esm1cmb) wrote: > I am receiving "/home/users/me/foo.pl did not return a true value at > ./program1.pl at line 2" > where line 2 is the "require". That's the semantics of "require" (see perldoc -f require). The standard idiom is to place 1; at the end of foo.pl, so that the la

RE: Help with "use"

2004-07-09 Thread Bob Showalter
BOLCATO CHRIS (esm1cmb) wrote: > It doesn't seem to be foo.pl that is causing the error is seems to be > coming from "use AnyDBM_File;" Why do you say that? > Could this be? That AnyDBM_File doesn't return a true vlaue? Did you add 1; To the end of foo.pl? You need to. -- To unsubscribe,

RE: Proc::Fork

2004-07-13 Thread Bob Showalter
Michael Gargiullo wrote: > I receive an error while running this script. It goes an gets a list > of > IP addresses that are on the network, then collects SNMP data from > them. > ... > When the script is run I see this output: > > ... > Can't locate object method "writer. via package "IO::Pipe

RE: Proc::Fork

2004-07-13 Thread Bob Showalter
Bob Showalter wrote: > You want to have some communication between the > children and the parents so the child can tell the parent when he's > ready to receive the next message. Here's an example using a pipe for the children to signal the parent: #!/usr/bin/perl use

RE: 2 Socket questions

2004-07-14 Thread Bob Showalter
Kelvin Wu wrote: > hello, > > > 1, how to use http 1.1 via IO::Socket? Create a tcp connection to the server using IO::Socket->new and send the HTTP request. Read the response and handle it appropriately. Better yet, use a higher-level module like LWP::Simple or LWP::UserAgent for this. > > 2,

RE: how to extract digit from a line in Perl

2004-07-14 Thread Bob Showalter
Franklin wrote: > Hello: > > I want to extract the digit from a line of text. For exmple, for a > text line: TSC2101Net, how can I write a script to extract 2101 and > print it? Use a regex to capture a series of digits: $_ = 'TSC2101Net'; my ($num) = /(\d+)/; print "Found $num\n" if def

RE: $^T inconsistant?

2004-07-14 Thread Bob Showalter
perl.org wrote: > We can all breath a sigh of relief now that I believe I've identified > this as my bug. I would say the true root cause is that Perl doesn't > support prototyping properly and named parameters at all though... I second the "huh?" How did prototyping relate to the trouble with $

RE: $^T inconsistant?

2004-07-14 Thread Bob Showalter
perl.org wrote: > On Wed, 14 Jul 2004 13:26:36 -0400, Bob Showalter wrote > > > > I second the "huh?" > > > > How did prototyping relate to the trouble with $^T? > > > > How do you define "support prototyping properly?" > > B

RE: Help a newbie to pick best version of Linux for Perl and perl /TK.

2004-07-14 Thread Bob Showalter
Marco Perl wrote: > Hi, Could you tell me what version of Linux is the most stable and > with most lib modules to do pearl and perl/TK? http:/www.freebsd.org I couldn't resist... :~) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: $^T inconsistant?

2004-07-14 Thread Bob Showalter
perl.org wrote: > I would like to use them if just for documentation purposes - it is > just slightly more clear to me to see > > sub something( $$$ ) > { > > than > > sub something > { Except that those are different in much more that just "documentation". Don't go that way... -- To unsubscr

RE: $^T inconsistant?

2004-07-14 Thread Bob Showalter
perl.org wrote: > On Wed, 14 Jul 2004 15:33:21 -0400, Bob Showalter wrote > > > > Except that those are different in much more that just > > "documentation". Don't go that way... > > I still don't understand the reasoning for this - how could addin

RE: $^T inconsistant?

2004-07-14 Thread Bob Showalter
perl.org wrote: > On Wed, 14 Jul 2004 15:45:52 -0400, Bob Showalter wrote > > perl.org wrote: > > > > > > I still don't understand the reasoning for this - how could adding > > > more to the sub signature be worse than not having any? > > >

RE: search text

2004-07-15 Thread Bob Showalter
manojkumar vajram wrote: > Plz. help me . I am new to perl > I want to accept a pattern from screen > and search the pattern in my one or two text data base > and print the details > > The pattern from screen may consist spaces and special > char. line / - etc. > I use redhat linux 8.0 > I have co

<    2   3   4   5   6   7   8   9   10   11   >