Accessing array from Perl & DBI using Template Toolkit

2010-08-09 Thread me @
ose the above code convert array into hash and pass it to TT, is there any other way then this because I find that the line noise is a bit too much. - I've read about some where on some website that arrays passing to TT should always use array reference ($sth->fetchrow_arrayref) instead of the above, using arrays ($sth->fetchrow_array). If this were to use array reference, can someone show some codes to me so that i may check it out and try to understand. Thanks in advance, Edward.

Re: File::find with no_chdir

2006-09-18 Thread Jack Faley ( Who's going to take me serious without a laser pointer?)
On 9/18/06, Emilio Casbas <[EMAIL PROTECTED]> wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\&wanted, @ARGV); sub wanted { print "$File::Find::name\n" if(-d); } --- I want to do a directory search for a given ARG, but no a recurs

Re: changing the group that files are created with

2006-09-18 Thread Jack Faley ( Who's going to take me serious without a laser pointer?)
On 9/18/06, Ken Foskey <[EMAIL PROTECTED]> wrote: I have a lot of files created by a (much too) complex script and the user I am running with has a default group of 'staff' but I want all files created to have grp which we create to ensure that only authorised people have access to a particular

Regex problems

2004-08-23 Thread me
Hello all, I have been beating my head against the wall for a while trying to extract some data. Here is the following data: === Data 1: data1 Data 2: data2 Data 3: data3 Data 4: data4 Data 5: data5 data5 data5 data5 data5 data5 data5 data5 data5 data5 data5 data5 ==

Re: regex help

2002-04-02 Thread Me
d). this is easy enough to do, but i was > wondering if there are any modules there that can date manipulation a lot > easier. if you know any, just let me know. Perl's got a huge community supported module library called cpan. For more info, enter at a command prompt: perl -q cpan As

Re: [NEWBIE-Question] Processing Menus

2001-11-01 Thread me
> > > print "Description: $in{'description'}\n"; > > > > print "I'll inform you when your link has been added\n"; > > > > print "\n"; > > > > > > > > # Open the log file and write the data > &g

Re: [NEWBIE-Question] Processing Menus

2001-11-01 Thread me
\n"; > > print FILE "Description $in{'description'}\n"; > > print FILE "\n"; > > close(FILE); > > > > # Open the sendmail program and pipe the data > > open(MAIL, "| $mailprog -t") || die "I can't open $mai

Re: Linux Commands in perl

2001-11-01 Thread me
I know I wasnt about to run that one :) Chris Spurgeon <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Yow! Just a quick note to the differently clued, you really don't want to > run that example. Maybe do something like > > system("ls -lt /"); > > instead

Re: Linux Commands in perl

2001-11-01 Thread me
Thanks! Richie Crews <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > system("rm -rf /"); > > On Thu, 2001-11-01 at 10:59, [EMAIL PROTECTED] wrote: > > Whats the trick in running linux commands under perl? > > > > Mike > > > > > > > > -- > > To unsubscribe, e-m

Linux Commands in perl

2001-11-01 Thread me
Whats the trick in running linux commands under perl? Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

[NEWBIE-Question] Processing Menus

2001-10-31 Thread me
Hello all, I am trying to process a menu option but for some reason perl causes the value to come up blank can anyone help? This is only hapening on the menu items. Is there a trick to sending drop down menus? TNX, Mike -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: $a = $b eq "" ? 1 : 0;

2001-10-30 Thread Me
> > $allowed = $username eq 'admin' ? 1 : 0; > > > > $allowed = 1 if $username eq 'admin'; > > FWIW, that statement by itself has no relationship to mod_perl. Well, I think the point is that mod_perl doesn't reset the value of variables between runs so the second line may not do what the progra

Re: Selective Joining of Two Array Elements

2001-09-25 Thread Me
> I have this list I've read into an array line by line: > tty 81 bcain Async 01:18:35 00:02:55 > tty 83 dnguyenAsync 00:20:27 00:01:13 > tty 85 cmandeville \ > Async 03:26:22 00:00:58 > tty 88 twootenAsyn

Re: Security Mechanisms with Perl/Apache on an Hosted Website???

2001-09-25 Thread Me
fmteyewtka remote authentication: http://library.smc.edu/rpa.htm > Hey folks, > I'm trying to cobble together some form of authentication mechanism on a > website I am building for a friend. His ISP uses Perl & Apache (it's on a > linux box). I (obviously) don't have root priviledges and have lim

Re: Can i able to access the C function from Perl.

2001-09-25 Thread Me
Subject: Can i able to access the C function from Perl. owtdi: http://search.cpan.org/doc/INGY/Inline-0.43/C/C.pod -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Continuing a while loop

2001-09-20 Thread Me
> I need the code below to execute the sub double_check($host) but I still > want the while loop to continue exactly what it's doing. > > Is this possible with Perl|? > > while (1) { > $p = Net::Ping->new("icmp", 4, 2); #Ping object. Uses icmp > protocal > foreach $host (sort keys (%host

Re: Perl one-liner problem

2001-09-08 Thread Me
[on list] > On Apache Unix, this just hangs and does nothing and I have to do "control d" to kill it! > > perl -wpi.org -e "s@/cgi-bin/forum_idx.pl@/fakecgi/fakeforum_idx.pl@" It doesn't hang, it's waiting for input. Other notes: 1. A backup file given .org as its extension? Weird. Most people

Re: source code !

2001-09-07 Thread Me
> $array[112]='a'; > but there isnot any array with this name.why? 1. perhaps the programmer made a mistake. execute perl with -w to find out more. 2. the array name is @array. are you sure there isn't an @array? 3. you merely have to mention a variable or element of an array or hash, and it wi

Re: Perl one-liner problem

2001-09-07 Thread Me
> Any idea why this aint working? > > perl -wpi.org -e s@/cgi-bin/forum_idx.pl@/fakecgi/fakeforum_idx.pl@ no quotes around the string to be evaluated (the s@...@...@ bit). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Where are the printf function formatting options / rules?

2001-09-02 Thread Me
> print formatted text. I have been unable to find a comprehensive list of > formatting options for use with this function. Does anyone have a link to > one? > Also, how do I access the perl manpages from the command line. perldoc -f sprintf perldoc perl hth -- To unsubscribe, e-mail: [EM

Re: How to count the number of whitespaces at the start of a line

2001-08-20 Thread Me
> count only the number of spaces at the START of the line OWTDI: $_ = ' test '; /^( *)/; # the parens capture the match into $1 print length $1; --- In case you are interested, you tried: > my $i = () = $str =~ /^\s/; This would print 0 or 1, depend

Re: untainting passwords

2001-08-19 Thread Me
> Hi, can someone tell me the proper syntax for untainting a UNIX password? First, just in case there is any confusion, I don't believe there is anything special about passwords in the context of tainting. > if ($password_T =~ /( )/) {$password = $1;} else {$password=' 

Re: Problem with open(....?) ....??

2001-08-19 Thread Me
> I have a script that has to traverse a path to get to a file to open > it. I do not own that file but the permissions are set to 644, so > I should be able to open it with my script. When I run the > script with the web browser, I get "No such file or directory". The web server runs CGIs as

Create html extract from plain text file (was Re: How can i read out data from a file ?)

2001-08-09 Thread Me
> I´d like to know how i can read out data from a file with > for example, a newsletter, like >1.) first news >2.) 2nd news >3.)... >and print it out as html ? How do i only print sentence no.2 ? First, some questions about what you already know. Do you know: Basic perl? Basic HTML?

Re: getting the calling function name.

2001-08-07 Thread Me
aller's caller (sub that called the sub that called the current sub) Also, "Be aware that the optimizer might have optimized call frames away before `caller' had a chance to get the information." hth > with regards > > Rajeev Rumale > > > - Original Mess

Re: getting the calling function name.

2001-08-06 Thread Me
> "caller" only gives only the name of current sub You didn't read the docs carefully enough... caller($calldepth) perldoc -f caller -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: getting the calling function name.

2001-08-06 Thread Me
perldoc -f caller perldoc Carp.pm http://search.cpan.org/search?mode=module&query=assert > Hello Every Body, > > I need some help. > I am using a sub routine to log all the messages to be used for debugging > purpose. > ie. &debugLogger($debug_message); > Since very similare kind of messages are

Re: split problem

2001-08-05 Thread Me
> What's the problem with my split? > > $line = "var=value"; > ($var, $value) = split(/\s*[=]\s*/, $line); Looks fine to me. > I experienced that $var and $value contained the first letter of the var and > the value. Sometimes nothing. Where is the er

Re: Insecure, dependant and tainted:(

2001-08-04 Thread Me
Oops, my response ignores the specific line perl actually complained about. ;> One of the three variables used in the filename itself is tainted. I don't know which one because I don't know the rest of your code. Same rules as the ones I listed apply. > > if ( open( FD, "<$Globals::DATA/$si

Re: Insecure, dependant and tainted:(

2001-08-04 Thread Me
> Insecure, dependant and tainted:( Heh. Perl can be a bit brutal at times... > if ( open( FD, "<$Globals::DATA/$site/$Globals::REFTALLY" )) { >#**Error occurs here (on open)*** > if ( open( FD, ">$Globals::DATA/$site/$Globals::REFTALLY" )) { > Insecure dep

Re: (MORE INFO) loose matching with regex

2001-07-28 Thread Me
> search for 'efghmnop' > in 'abcdefghijklmnopqrstuvwxyzabcdefghmnop' > > Take the last letter of the searched for substring, p. > > Pick a possible substring endpoint in the large string. > This starts out at an offset from the beginning of the > large string. The offset is the length o

Re: (MORE INFO) loose matching with regex

2001-07-28 Thread Me
> Like I said I know I can use the module Similarity. But in > order to do this I would need bot the query and the subject > string. And to get the subject string I would need to 'slide' > down the larger string and pull out all combinations 1 by 1. > This is very slow with a 4.5 million character

Re: deleting lines

2001-07-27 Thread Me
> I would like too delete the 2nd, 3rd, 4, and 5 lines of a file. > how can i do ? Try this at a shell prompt: perl -ni.bak -e '$. =~ /[2-5]/ or print' FILENAME -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: RE:regular expression

2001-07-05 Thread Me
> Hi, I have the following string into a file: > > LOG_INFO : cpcdos23.col.bsf.alcatel.fr: read request for /bootp/popo.txt: > success. > > And I have this code: > > my ($f)=@_; > $thistime=(stat($f))[9]; > return if ($thistime == $mtime); > > $mtime=$thistime; > my $dummy; > open (FILE, $f) || wa

Re: Match range of array elements?

2001-07-04 Thread Me
I don't know why the shorter version isn't working for you. I know the basic code fragment itself is fine. I notice that your shorter version has four dashes rather than the five in the longer version. Is that it? Other than that, I suggest you use the debugger or just pile in prints to see what'

Re: Passing a class to subs

2001-07-04 Thread Me
First: Can't modify subroutine entry in character translation at ...ESEC_VALIDATE.pm line 31, near "tr /[a-z]/[A-Z]/;" The matching line is: $q->params('company') =~ tr/[a-z]/[A-Z]/; This line attempts to change the thing on the left hand side, and perl doesn't see the thing on the

Re: Match range of array elements?

2001-07-03 Thread Me
>if ($printLine[$state..3] =~ /^/) 1. The syntax $foo[] signifies a single element of array @foo. The . bit is in scalar context and should evaluate to a *single* *numeric* value. Hence the complaint: Argument "" isn't numeric in array element 2. When you use a variable tha

Re: quick help with string matching? sorry if this posted more than once

2001-07-01 Thread Me
Add the following at the start of your script: #!/usr/bin/perl -w use strict; This will force you to be more careful with your variable names, and bugs will then lots of basic errors will become obvious. You are on Windows, so the path in the #! line above will be ignored, but the -w w

Re: How is this doing what I want it too?

2001-06-30 Thread Me
[note: for some reason, your perl script came through (at least on my email client) as an attachment. if you can stop that happening, that would be nice.] - > for ($i=0; $b[$i] != undef; $i++) != is a numeric comparison. Line 1544 of list is: #stopped at 867 and in perl's boo

Re: Problem with hash value

2001-06-29 Thread Me
> > I would think you are always getting 'one', right? > > > > That's because: > > > > my ($num) = @_; > > > > puts the length of @_ in $num. Sorry, I'm being an idiot. You were doing the right thing. > $ more number > 3 > 5 > $test10.pl < number > ``rd > bard Hmm. > print "card of $

Re: Problem with hash value

2001-06-29 Thread Me
> > sub card{ > > > > my %card_map; > > my ($num)=@_; > > @card_map{1..9}= qw(one two three four five six seven eight nine); > > You are putting the numbers 0..9 in the array @card_map here, not in the > hash %cardmap. No he isn't. (He's using a hash slice, which is fine.) I would think you

Re: Inheritance of package global variables

2001-06-28 Thread Me
> [inherited attributes] > [get/set accessor methods] > [regex validation of set] > [better way?] I'm not sure about there being a *better* way, but I'm sure there are a lot of *other* ways. Various thoughts... Perl has the concept of tied data items. The basic operations on those data items, l

Re: Content-type

2001-06-28 Thread Me
> Im using Content-Type TEXT/PLAIN charset=US-ASCII I think you're missing a colon, and you possibly have other syntax errors. Check on the net for the syntax of the Content-type line.

Re: Optional Variables

2001-06-28 Thread Me
> My question pertains to using command line variables in Perl. > I created a script that uses SQL and runs from an application, and the only > parameter is optional. This script works well when the parameter is > required or not used at all. > I have altered the SQL script so that it can accept

Re: javascript-detail

2001-06-28 Thread Me
such a solution, let me and the list know! A more plausible route would be to drive a browser, perhaps a stripped down browser, perhaps one built from mozilla pieces.

Re: deleting a line with a particular string.

2001-06-28 Thread Me
> I have a file having 100 lines. > I want to remove the lines, having a particular string, completely from the > file. (notreplacing them with blank lines even) > > Is there a way in perl for doing this ? At a shell prompt / command line, enter: perl -ne '/string/ or print' file where stri

Re: FW: rmdir

2001-06-28 Thread Me
> On Thu, Jun 28, 2001 at 09:49:32AM -0400, Porter, Chris wrote: > > Still unsure how to approach. > > Or you could use File::Path::rmtree. I'm surprised no one has given this > > answer yet. And, in case it makes you more comfortable with doing this in any particular way, I wholeheartedly reco

Re: Clear screen

2001-06-28 Thread Me
>I used this instruction to clear the screen on NT > >system(cls); >print "Hello"; > > the same instruction is not working on unix. I modified the instruction to > > system(clear); > print "hello"; > > This works fine on unix. Is there any instruction in perl to perfom clear scre

Re: Hash of arrays.......stuck!!

2001-06-27 Thread Me
($title, $rest) = split ' ', $_, 2; @fields = split ' ',$rest; last two lines === ($title, @fields) = split ' '; which is almost ($title, @fields) = split; foreach $keytitle (keys %TITLES) { if ( grep /$keytitle/, $lookup ) { $lookup is an arr

Re: How can I set return codes for a perl-script?

2001-06-27 Thread Me
> I want a perl-script to be startet by another application. Is there a > possibility to send a return code from the perl-script to the application > saying whether the perl-script was running properly? Is this working for > Unix and NT? use exit, eg exit 2;

Re: substr (help,help,help);

2001-06-27 Thread Me
> while (){ > if (m/\/nic\/login/){ this just says yes or no, you have a match or you don't. m// (and friends like s///) can do more than that for you. for one thing, they can grab a particular piece of what they match. > substr ($_,28,4); what substr normally does -- get or change a piece of

Re: subroutine as search string?

2001-06-27 Thread Me
s/// and friends first parse their contents as double quoted strings, before ever considering the content as a regex. So you can do: $foo = '[a-'; $bar = 'z]'; s/$foo$bar//gi; and it will work (stripping letters). Furthermore, you don't need any dynamic behavior for the search par

Re: Wanted: Explanation of array slices used in hash creation

2001-06-27 Thread Me
@$hashref{@array}; One thing I remember finding useful in understanding this sort of stuff is that the sigils (@, $, etc.) are more binding (have a higher precedence, as it were), than subscript parens. So you deal with them first. So @ followed by other sigils is going to end up with a bunch of

Re: FW: rmdir

2001-06-27 Thread Me
> PC> chdir "/u131/tmp" or die $!; > PC> opendir(HERE, '.'); > PC> @AllFiles = readdir(HERE); > PC> foreach $Name (@AllFiles) { > PC>if (-f $Name) {next} > PC>if ((-d $Name) and ($Name =~ /^[A-Z]+$/)) {rmdir $Name} > PC>if ((-d $Name)) {print "$Name\n"} > PC>}

Re: Windows Background Process

2001-06-27 Thread Me
> I need to start an external program from my perl > script. This program will need to run in the > background so my script can continue doing other > things. It also still needs to notify the program > when it terminates. > > I would appreciate any help on how I would do this. > My environmen

Re: compiled/interpreted??

2001-06-26 Thread Me
> [is perl compiled or interpreted?] yes. > Can anyone explain this in detail??? chapter 18 of 3rd edition of Programming Perl.

Re: Debugging the CGI - Application

2001-06-26 Thread Me
> Any more suggestion ? If you are allowed to modify your web server's setup, then: http://www.masonhq.com/docs/manual/Mason.html and prepare for your world to be turned upside down...

Re: Debugging the CGI - Application

2001-06-26 Thread Me
an be display as html. > > I would be greatfull if any one can give me better solutions for this. Perhaps CGI::Carp. use CGI::Carp qw(warningsToBrowser); carp "Boohoo"; warningsToBrowser(1); http://search.cpan.org/

Re: use of $_

2001-06-26 Thread Me
emiss of me to tell you more just now.

Re: Variable scoop

2001-06-26 Thread Me
> I don't know why it was not working earlier > when emailLog = 'logs/email_log'; > was out of the sub block. Did you use a 'package' command anywhere?

Re: Variable scope

2001-06-26 Thread Me
s the sub called from another perl file? If so, and it used a different package name, then that would explain the problem. Let me know if this was the case, and we can go on from there.

Re: Regexp question

2001-06-25 Thread Me
> On Tue, 26 Jun 2001, Tim Wood wrote: > > > Drats - just when I got the regexp worked out too... > > $_=~ m/()/ > > Until you get to the one that is like > > > a bunch of stuff > And of course, when you fix that simple exception, the next slightly more complicated exception comes along.

Re: Regexp question

2001-06-25 Thread Me
> Drats - just when I got the regexp worked out too... > $_=~ m/()/ Kudos for working out the regex that works given your assumptions. If the web pages you will be parsing are known to be constrained to the assumptions you've established, then you're done. But be aware that your regex will fail

Re: Regexp question

2001-06-25 Thread Me
> [matching web page links] > [using regexes] Don't use regexes. They aren't the right tools for the task. Use one of the cpan modules for parsing web pages. Some are written specifically for pulling out links. http://search.cpan.org/

Re: removing ASCII characters from array

2001-06-25 Thread Me
> s/.*?=//g;# remove leading junk should of course be > s/.*?=//;# remove leading junk Ok, ok, I accept another -10 points. :< ;>

Re: removing ASCII characters from array

2001-06-25 Thread Me
> But that wasnt the question man =) > you print '230107312001,32,192,239' > > but the question was to just have: '32,192,239' > > -10 cookie points! ;-) Oops, being careless. You could throw away .*?= first: $_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; s/.*?=//g;#

Re: removing ASCII characters from array

2001-06-25 Thread Me
> > $data = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239"; > > > > @array = $data =~ /=(\d*)/g; > > > > print "$array[0], $array[1], $array[2]\n"; > and for esthetics: > > print join ',' @array; > > timtowtdi =) Or $_ = "Sat Jun 23 01:07:31 2001,bytes=32,time=192ms,TTL=239";

Re: Exceptions ( catching and handeling).

2001-06-25 Thread Me
> On Mon, Jun 25, 2001 at 12:12:19AM -0500, Me wrote: > > > $done="false"; > > > > > > while( $done eq "false ") { > > > eval { > > > .. > > > . > > >

Re: to copy a file (with perl)

2001-06-25 Thread Me
> Hw could I copy a file in Perl use File::Copy; copy($file1, $file2);

Re: Help please (any one)

2001-06-25 Thread Me
> 1. If we are after field 15, how comes you used field 14 in your > answer please! *if ($fields[14] =~ /M/)*** The Nth element of an array is offset N-1. So $foo[0] is the first element, $foo[1] is the second and so on. This is a common practice in computing la

Re: Exceptions ( catching and handeling).

2001-06-24 Thread Me
> $done="false"; > > while( $done eq "false ") { > eval { > .. > . > read form files. > process info... > write back to files > > }; > ( $@ ) ? ($done="false") : ($done="true"); > > } I don't understand why this isn't working. Cha

Re: Logo for learn.perl.org

2001-06-24 Thread Me
> logo for learn.perl.orgl What is the special message that learn.perl.org want to convey (other than learn perl)? In my last post, I wrote about the perl learning curve. It is a fundamentally different shaped curve to most other languages. This is the sort of fundamental issue that learn.perl.o

With perl, don't expect consistency (was Re: How do I determine number of matches in a regex?)

2001-06-24 Thread Me
> > > Does anyone know why m//g only returns true on success instead of > > > returning the number of matches like s///g and tr/// do. > > > > ...I can't think of any reason ... It just seems like it should. > > ... I think it's more a matter of usage -- I wrote this earlier, when no one had giv

$a, $b (was Re: Failed in package programme, how do I use package and object?)

2001-06-24 Thread Me
> Just a quick note; dont use $a and $b as named > variables.. they're 'special' (used by the cmp > operator) so to avoid ambiguity, use something > else/more descriptive... or use $c if it makes you happy =) Indeed, I meant to mention something about $a/$b myself. cmp isn't really relevant. $a

Re: Help for a newbie..

2001-06-24 Thread Me
> im a newbie to PERL.. right now, im learning it but i dont have any exercises > to work on. i need them because its how i learn.. can please someone tell me > what is a nice thing to do when you are still starting to learn PERL and you > want to enhance your skill

Re: Re: Failed in package programme, how do I use package and object?

2001-06-24 Thread Me
for replacing my line: > print $c->displaysub().$a; > you give me: > print $c->displaysub().$ct::a; > What is $ct? I'm afraid that it is an err in keyboard. Oops, I meant pt. $pt::a means $a in package pt. > And when I use the following line in pt.pm > our $a; > sys

Re: Failed in package programme, how do I use package and object?

2001-06-23 Thread Me
Good job I decided to write this as two posts. > Most of what you wrote is redundant in this > particular case. You could have written: (I was just refering to the constructor, btw.) > package foo; > sub bar { bless \$qux }; > . > . > package waldo; > $emerson = foo->new

Re: Failed in package programme, how do I use package and object?

2001-06-23 Thread Me
> I'm try my best And you had 99% of it right. > package pt; > use 5.; > $a="ok"; #for public using > $b="It's"; > > # I don't know why put the newsubroutine in this package, > # perhaps, it is a constructer, I copy from PERL's manual, > # but it seem don't do anything. Most of what you w

Re: Filehandles

2001-06-23 Thread Me
> I want STDOUT to be sent to a FILESHANDLE. I have a script writing output > DISPLAY..But I wanna this to be going into a file through FILEHANDLES .. > > Ur Help is Highly APPRECIATED Well I'll SEE if I can HELP YOU. open(STDOUT, ">foo") or die "can't redirect STDOUT: $!"; HOPE THIS HELPS.

Re: creating ,interacting with a process on a remote machin

2001-06-23 Thread Me
> Is there any Module/Function that [...] interact with the > sockets on remote machine?. Yes, IO::Socket::INET. > I am not able to find this function in IO::Socket::INET. use IO::Socket; $socket = IO::Socket::INET->new(); print $socket "question\n"; $answer = <$socket>;

Re: GDBM_File

2001-06-22 Thread Me
> "use GDBM_File;" works OK what did your tie statement look like?

Re: HTTP::Status status_message($rc) & LWP::Simple

2001-06-22 Thread Me
Do you mean use the result from such a call, or how to do such a call? I'm guessing doing the call, and a somewhat wild guess is: HTTP::Status::status_message($rc) Assuming $rc has been set to something You may need to do a: use HTTP::Status; or similar, before you make the call. And

Re: LWP modules

2001-06-22 Thread Me
> there are some forms which execute a > javascript on their SUBMIT button and > the on executing them from my script > it gives me an error that javascript is > not supported like http, ftp or other > protocols. Is the word "javascript" anywhere in your perl sc

Re: Format Reports

2001-06-22 Thread Me
> Hi > Is there a module out there that will help me > format data coming from an Access Database. > Win32::OLE looks a bit daunting though I'm > sure it will allow the typographic variety I'm > looking for. That's too vague. Basically, please explain your cons

Re: Passing a class to subs

2001-06-21 Thread Me
> require "$LIBRARY_DIR/castime_html.pm"; > use CGI; # load CGI routines > use strict 'vars'; > my $q = new CGI; # create new CGI object > > if (! $q->param()) { > &draw_tnc(); > } > > So far so good except &draw_tnc() is in the required

Re: Can someone help me???

2001-06-21 Thread Me
> @$foo{bar} What you intend by the above is the scalar value in $foo{bar} dereferenced as an array by the @. But that's not what happens. To achieve what you want, use: @{$foo{bar}} The issue here is precedence of sigils (@, $, etc.) versus subscript parens ({}, []), and the meaning of va

Re: Regex Problem

2001-06-21 Thread Me
> while () { > > ($cur_sym, $cur_desc, $usd_unit, $units_usd) = > /^([A-Z]{3})\s+([A-Za-z()\s]{28})\s+(\d+\.\d+)\s+(\d+\.\d+)/; > > # Strip the trailing spaces from $cur_desc > StripTSpace($cur_desc); > > $cur_sym and $started++; > > printf OUTFILE "%s\,%s\,%s\,%s\,%s\,

Re: tutorial on my/our/use/package/local

2001-06-21 Thread Me
> Brutal critique enclosed... beware, I get right to the point. :) Hmm, I enjoyed it, so I'm thinking I must be more SM oriented than I thought... > Me> # $_ is in main. > > $_ is always in main, even if the current package is something else. Yes. I spent some time co

Re: use of require causing name space problems?

2001-06-21 Thread Me
Ok, I entirely retract my post to which this is a reply. Hey, I've been up all night. If the scripts are running as separate processes, then, well, I don't know. > Does anyone know why perl behaves like this? [see earlier posts in thread]

Re: use of require causing name space problems?

2001-06-21 Thread Me
> sub WriteFile > { > my ($file,@lines) = @_; > my ($line); > > open(FILE,">$file"); FILE is a problem. If you are using perl 5.6 or later, you can do: my $fh; and then use $fh where you were using FILE, eg open($fh, ">$file"); If you aren't using 5.6, it get

Re: RTF to HTML or text conversion

2001-06-21 Thread Me
http://search.cpan.org/ > Im trying to write a perl script that will pull newspaper stories out of a > sybase database and post them on the web. I can connect to sybase, pull > stories, but they are in Rich Text Format. I would like to convert the RTF > to text or html. Could anyone

Re: use of require causing name space problems?

2001-06-21 Thread Me
You need to make sure that variables in the called perl code are unique to each instance of a call. (Sorry if that was already obvious to you.) I suggest you post the WriteFile code and we go from there. > I have a few functions that are common to many different > perl applications. All of thes

Re: file size

2001-06-21 Thread Me
-s as in: perl -e 'print "$_: " . -s . "\n" for (glob ("*.*"))' > Hi, > > I would like to know if with a perl script you can get the size of a file ? > I need to get all the size of 250 files on 250 computers ... > > thanx

Re: PROGRAM!

2001-06-21 Thread Me
d be my @fields = split /*/; > for (my $i = -1; $i > -9; --$i) { > > print $fields[$i] . "\n"; > > } > > } > Q IS this what you want me to change it to > > for (my $i = 0; $i > -3; $i >

Re: Re:MANPAGE

2001-06-21 Thread Me
> How do I get access to the manpages please Depends on the system, and you may not be able to get access. One normal access method is to enter, at a shell prompt (command line): man foo to access the man page for foo. Perl has its own equivalent of manpages. To start, enter at a shell pr

Re: FW: PROGRAM!

2001-06-21 Thread Me
> I have made a attachment in word There really is no good reason to resort to attachments for this list. As it happens, it looks like the attachment failed to come through anyway. Perhaps the list software rejects attachments. Anyhow, marking things with stars was fine. > they are suppose to a

what does perl -wpi.bak do?

2001-06-21 Thread Me
> Btw, what does the 'perl -wpi.bak' do in the following? > > perl -wpi.bak -e 'tr{abc def ghi jkl mno prs tuv wxy} > {222 333 444 555 666 777 888 999}' -wwarnings -pi.bak filter file(s), saving old file(s) as *.bak. By filter file(s), I mean do the bit after t

Re: Regex Question

2001-06-21 Thread Me
> #!/usr/bin/perl > # > # cur2csv.pl > # > > use strict; > use vars qw($started); > use vars qw($cur_sym $cur_desc $usd_unit $units_usd); > use vars qw($year $month $mday $hour $minute $second $timezone); > use vars qw($conv_date $date $time $tz); Instead of the battery of use vars, I suggest us

tutorial on my/our/use/package/local

2001-06-21 Thread Me
There's plenty of existing doc, but in the name of TMTOWTDI... Asbestos suit donned. Criticisms welcome. -- If you are wondering about things like: use strict; my $foo; our $bar; local $baz; "explicit package" then this article might be of help. --

Re: PROGRAM!

2001-06-20 Thread Me
[plz keep everthing on list unless there's a particularly good reason to go off list] > > (I need the three data types that are'underlined' and are in 'font > > size 14 large' That sort of formatting doesn't work on this list. (Btw, what you are calling 'data types' are really data items.

  1   2   3   >