Re: Problem with DBI and placeholders

2021-04-15 Thread mailing lists via beginners
, @row;     if ( ($#insert_rows % $#row ) == ($chunksize - 1) ){   $dst_sth->execute( @insert_rows );   undef @insert_rows;     };   }; [...] the @insert_rows array seems to consume inordinate amount of memory. Where can I be making the mistake?   On Saturday, April 10, 2021, 1

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
SELECT * FROM "test"; rather than  SELECT * FROM test; This isn't a problem for Postgres but MySQL doesn't accept quoted table names. On Fri, Apr 9, 2021 at 1:25 PM mailing lists via beginners wrote: I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
OM $table"); $sth->execute() && say "OK 2"; Em April 9, 2021 12:25:18 PM UTC, mailing lists via beginners escreveu: I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD-MySQL-4.023 perl-DBI-1.627 On Friday, April 9, 2021, 2:19:13 PM GMT+2, mailing l

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
I'm using: CentOS Linux release 7.9.2009 (Core) perl 5.16.3 perl-DBD-MySQL-4.023 perl-DBI-1.627 On Friday, April 9, 2021, 2:19:13 PM GMT+2, mailing lists via beginners wrote: without using the variable $table it also fails with the same error $sth = $dbh->prepare("

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
without using the variable $table it also fails with the same error $sth = $dbh->prepare("SELECT * FROM ?");$sth->execute("test") && say "OK"; On Friday, April 9, 2021, 2:12:01 PM GMT+2, mailing lists via beginners wrote: thanks Andrew

Re: Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
e" is probably what you want. On Fri, Apr 9, 2021 at 12:49 PM mailing lists via beginners wrote: Hello, I am having a problem with a very simple task and I don't see where the fault is. The first query works with problem but the second one fails with this error:  ./test.pl OK 1 DBD::my

Problem with DBI and placeholders

2021-04-09 Thread mailing lists via beginners
Hello, I am having a problem with a very simple task and I don't see where the fault is. The first query works with problem but the second one fails with this error:  ./test.pl OK 1 DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your M

Re: Converting string to float

2017-03-02 Thread mailing lists via beginners
just to clarify, the real purpose of the script is output the hash to a json object, so the json output for the script: #!/usr/bin/perl use strict; use warnings; use Data::Dumper; use JSON::PP; my ($input_string, %job_task); sub sanitize_data{ my $data = shift; $data->{'work_hours'} = (split

Converting string to float

2017-03-02 Thread mailing lists via beginners
Helo all, what I am trying to do is convert a value contained whitin a hash from string to float, but I fail to find the error, this is that I have tried: $ cat test.pl #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my ($input_string, %job_task); sub sanitize_data{ my $data = sh

problem with AnyEvent and blocking events

2016-03-10 Thread mailing lists
Hello teachers, I'm converting a simple perl multimedia script to an event based one, but it seems that I'm missing something very basic because I'm unable to make it work. The script receives commands from Lirc::Client (1.54) via next_codes() which is in blocking state whilst no data is avai

Re: advice about event programming

2014-11-13 Thread mailing lists
Hi Carl, > http://stackoverflow.com/questions/2232471/how-do-i-use-async-programming-in-perl > http://search.cpan.org/~mlehmann/AnyEvent-7.07/lib/AnyEvent.pm > do you think that AnyEvent is better than POE? since I know nothing about both I prefer learn the correct one even if it is a little

advice about event programming

2014-11-13 Thread mailing lists
Hello all, I have a little home proyect to learn programming using a raspberry with lirc (Lirc::Client), the music player daemon (Net::MPD) and lcdproc ( Net::LCDproc), each component works individually, but now I need glue all this parts and the problem is that I am not sure on how to do it.

Re: DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name

2013-10-09 Thread mailing lists
The error is the comma before AUTO_INCREMENT. Sorry for the noise. - Mensaje original - De: mailing lists Para: "beginners@perl.org" CC: Enviado: Miércoles 9 de octubre de 2013 11:10 Asunto: DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no co

DBD::SQLite::db prepare failed: table turba_shares_2013_10_08 has no column named share_name

2013-10-09 Thread mailing lists
Hello, I have to do a simple backup, but I fail to see why this part (see attachment) of my script fails: $ ./test.pl INSERT INTO turba_shares_2013_10_08 (share_id, share_name, share_owner, share_flags, perm_creator, perm_default, perm_guest, attribute_name, attribute_desc, attribute_params

problem with nested regex matchs

2012-03-07 Thread mailing lists
Hello, is there any way to extract the queued ID (7BC5A446) from the first line and also match the second with only one regex?? #!/usr/bin/perl use strict; use warnings; use 5.010; while(){     if (/^(?\S+?)\s+?(?\S+?)\s+?(?\S+?)\s+?(?\S+?)\s+?(?\S+?):\s+?(?\S+?):\s+?to=(?\S+?),\s+?relay=(?\

Sending files efficiently with Net::SMTP

2012-02-23 Thread mailing lists
Hello all, I have a perl (Ver. 5.10.0) program running over an old machine which send messages with this code:     my $smtp = Net::SMTP->new($dstMailServer, Timeout=>10, Debug=>0,);     unless(defined($smtp)){     syslog LOG_INFO, "id:%s error: unable to connect with %s", $myid, $dstMailS

Re: understanding the ||= operator

2011-02-11 Thread mailing lists
>> 12$sheet -> {MaxRow} ||= $sheet -> {MinRow}; > >Line 12 can be written as: >$sheet->{'MaxRow'} = $sheet->{'MaxRow'} || $sheet->{'MinRow'}; then that I don't understand is the program logic :-( what's the purpose of lines 12 and 14?? -- To unsubscribe, e-mail: beginners-unsubscr.

understanding the ||= operator

2011-02-11 Thread mailing lists
Hello, for the following program, what is the function of lines 12 and 14 ??? 1 #!/usr/bin/perl 2 3 use strict; 4 use warnings; 5 use 5.010; 6 use Spreadsheet::XLSX; 7 8 my $excel = Spreadsheet::XLSX -> new ('Datos RCP 4_2_11-v2.xlsx'); 9 10 foreach my $sheet (@{$excel -> {W

SOLVED re: GD::Text::Wrap

2009-09-29 Thread Jo for lists and groups
I think I had black text on a black bg or it was outside of the image. After some trial & error, I got it to work. Corrected version is below along with notes to clarify since I found the module notes to be scant. Jo #!/usr/bin/perl use strict; use warnings; use CGI; use GD; use GD::Text::Wra

GD::Text::Wrap

2009-09-28 Thread Jo for lists and groups
I originally started with GD $image->string(); which worked fine, except the text is too long. I then found text::wrap could be the solution, but I can't get it to work. I am trying to print red text on a black background. I am only getting the background. What am I missing or doing wrong? Jo

RE: sort with special order

2009-07-24 Thread Jo for lists and groups
How about this? Jo #!/usr/bin/perl use strict; use warnings; my @list = qw/dog is a there/; my @sortOrder = (3,1,2,0); my @sorted; foreach (@sortOrder) { push(@sorted,$list[$_]); } print "@sorted"; exit; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands

RE: child/parent issues (was Tar or system interference with while )

2009-07-16 Thread Jo for lists and groups
Hi! Thanks for your time, John. You solved the mystery! :) Now I shall resolve my problem! As for that open to fork a child, I got that from Perl Cookbook 19.6 and echoed by a couple of other sources as I spent days looking and learning about ways to minimize security risks with issuing system co

RE: Tar or system interference? (NOT having to do with while )

2009-07-16 Thread Jo for lists and groups
ANOTHER CLUE: I dropped the tar -tzf tesing portion of sub bakkup. There is now only one system call, and the email sending is now only doubled up. Child or Exit codes issue? Jo sub bakkup { my $archive ="/home/devsite/bakTEST/$todayUTS.tar.gz"; my @filesToBackup = ("$petFi

RE: Tar or system interference with while ?

2009-07-16 Thread Jo for lists and groups
Okay, I stripped it down to 2 subroutines. Maybe easier to troubleshoot? The below sends 4 email messages. If I skip &bakkup; by commenting out, it sends 1 message as expected. WHY? What's in &bakkup that is interfering with other actions? Jo #!/usr/bin/perl -Tw use strict; $ENV{'PATH'} = '/b

RE: While issues

2009-07-16 Thread Jo for lists and groups
Are you supposed to be printing something here? Somewhat newb, but this doesn't look right to me: print (FO); I'm guessing you want to remove commas and so are rewriting the line into a new file after subst. I'd probably do print FO "$_"; I suspect your way may just be leaving the server

Tar or system interference with while ?

2009-07-16 Thread Jo for lists and groups
Greetings All! I am stumped and hoping someone can help solve this mystery. It seems I have introduced a bug in my script while attempting to move from a simple duplicate file backup (using File::Copy copy) to a tar.gz method to conserve space. I've cut out most of the extraneous stuff, what's le

process snapshot

2007-12-23 Thread lists user
How to get a process's snapshot data in perl like Apache::Scoreboard for apache processes? Happy holidays guys! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

RE: get full month name

2007-12-09 Thread Jo for Groups and Lists
Can you use Date::Manip ? $fullMonth = &returnFullmonth($month); sub returnFullmonth { use Date::Manip; return UnixDate("2007/$_/01",'%B'); } This will handle feb, 02, or 2 but will not handle february itself - so you may want to check first that you are indeed passing in 1-2

double-bytes characters

2007-11-26 Thread lists user
I'm not so familiar with handling double-bytes characters. I have a string like this (from an email subject): =?gb2312?B?u7bTrdeisuE=?= how to create this string? and how to decode it? Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http:

Conditions and actions in an external chart ?

2007-11-20 Thread Jo for Groups and Lists
Is there a way to store and retrieve code for conditions and actions in a chart? Something like Condition action $Pet eq "dog" $suggest.="Buy a Bone?" $numBiscuits >1 $subTotal+=($numBiscuits*2.00) ($cond,$act)=split(/\t/); if ($cond) { $act; } I haven't a clue what I need to lo

RE: :mysql::st execute failed: Column count doesn't match value count at row 1 a

2007-11-16 Thread Jo for Groups and Lists
After viewing this again IN PLAIN TEXT You have an unmatched double quote here. AND an unmatched single quote AND a backtick. No wonder it's not behaving as expected. Would have been easier to spot without that stationary. Jo -Original Message- From: Jo for Groups and

RE: :mysql::st execute failed: Column count doesn't match value count at row 1 a

2007-11-16 Thread Jo for Groups and Lists
my $sql="insert into $table values ('2345','4355','834','894,'766'); You have an unmatched double quote here. Jo <>

RE: outlook module

2007-11-01 Thread Jo for Groups and Lists
It seems to me that your network admins need to correct their faulty procmail routing recipes. It should not be your job to deal with this. Do the network admins have any idea how big a problem this is? Not only for your inconvenience, but for the other person not receiving messages? Jo -- To u

How to prevent split from returning blanks

2007-10-28 Thread Jo for Groups and Lists
What I want are these array members from a string in a database. I'm almost there, just need to strip off the trailing pipe, but I am getting empty members too, so will have to test for that and dump the empty ones before proceeding. Is this the best solution? {No, we can't change the database form

help on ip addr

2007-10-26 Thread lists user
Hello, I want to do the things below: a) get all binded IPs on a redhat linux os.there are maybe more than one IP,like eth0,eth1,eth0:1 etc. b) for each IP,I need to know if it's a private network address (like 192.168.0.1) or a public network address. for the first problem I can read something

local *FH

2007-10-17 Thread lists user
I saw this code piece in perldoc perldata, sub newopen { my $path = shift; local *FH; # not my! open (FH, $path) or return undef; return *FH; } $fh = newopen('/etc/passwd'); why it say a 'l

double-bars graph

2007-09-19 Thread lists user
Hello, I know how to make graph with GD::Graph::bars. But how can I make the double-bars for each element? I'd like the graph looks as, ip pv |-- -- ip pv |-- -- -- -- |-- -- -- -- |-- -- -- -- |___ 0901 0902 Thank you! -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: autoload

2007-09-13 Thread lists user
Really great answer.Thanks Chas. 2007/9/13, Chas Owens <[EMAIL PROTECTED]>: ... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

autoload

2007-09-13 Thread lists user
Hello, Why we need AUTOLOAD and what's the usage of $AUTOLOAD? Can you show an example to help explain it?Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

about variables destruction

2007-09-03 Thread lists user
When destructing a variable,one can say `$var = ''` or `$var = undef`,which way is good? like two cases follow, sub DESTROY { my $self = shift; $self->{array} = undef; } or sub DESTROY { my $self = shift; $self->{array} = ''; } Given $self->{array} is a large array's reference.

a division warning

2007-08-26 Thread lists user
I run a perl command below, perl -Mstrict -Mwarnings -e 'eval {my $x=3;my $y=$x-3;$x/$y};print "hello"' Useless use of division (/) in void context at -e line 1. hello I'm confused about the first warning.What's it?thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: Trying to dynamically create arrays, getting can't use string as ARRAY ref

2007-08-23 Thread lists user
Hi, Rather than a dynamic array,you just need to use a correct datastru,a hash. It's maybe better to write codes as below. [tmp]$ cat groups.txt prod01 456 345 234 prod02 789 517 325 prod03 789 517 325 prod04 789 517 325 prod05 789 517 325 [tmp]$ cat test.pl #!/usr/bin/perl use strict; use warni

[EMAIL PROTECTED] and [EMAIL PROTECTED]

2007-03-22 Thread Jm lists
Given the case, my @array = (1,2,3,4); my $var1 = [EMAIL PROTECTED]; my $var2 = [EMAIL PROTECTED]; What's the difference between $var1 and $var2? Are they all refered to @array? Thanks guys. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://l

Question about a class

2007-03-18 Thread Jm lists
Hello, Consider this script (coming from Randal's book): { package Animal; sub speak { my $class = shift; print "a $class goes ", $class->sound, "!\n"; } } { package Mouse; @ISA = qw(Animal); sub sound { "squeak" } sub speak { my $class = shift; $class->SUPER::speak(@_); #***t

about reference

2007-03-17 Thread Jm lists
Hello members, What's the difference between Perl's reference and C's pointer? I'm always confused about them.Thanks for any direction. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: about creating an array

2007-03-15 Thread Jm lists
Thanks John.That's the right way. Another question,what's the regex of "\s+\z" ? 2007/3/16, John W. Krahn <[EMAIL PROTECTED]>: Jm lists wrote: > hello lists, Hello, > please see the codes below: > > use strict; > use warnings; > my @arr = (

Re: about creating an array

2007-03-15 Thread Jm lists
source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. $ uname -r 2.6.17.4 2007/3/16, Rob Dixon <[EM

Re: about creating an array

2007-03-15 Thread Jm lists
1688 1689 1690 1691 1692 1693 $ perl test.pl 1693 It's really happened to me.So faint! 2007/3/16, Rob Dixon <[EMAIL PROTECTED]>: Jm lists wrote: > > hello lists, > > please see the codes below: > > use strict; > use warnings; > my @arr = (); > open HD,&qu

about creating an array

2007-03-15 Thread Jm lists
hello lists, please see the codes below: use strict; use warnings; my @arr = (); open HD,"itemid.txt" or die $!; while(){ chomp; push @arr,$_; } close HD; print "@arr"; the itemid.txt has 470 lines data,looks like: 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219

Re: Where can I get the Perl library modules

2007-03-07 Thread Jm lists
Whoops, that is the 64-bit version. This the normal version: http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.820-MSWin32-x86-274739.msi Do I need to pay for it? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://lea

what's the difference between $1 and \1?

2007-03-06 Thread Jm lists
Hello, $s="hello,test"; the 1st statement: $s=~s/^(\w+)/$1 / the 2nd statement: $s=~s/^(\w+)/\1 / What's the difference between these two statements? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

How to get all the files under the webdir?

2007-02-13 Thread Jm lists
Hello lists, I want to get all the files on some a webdir.For example: http://www.foo.com/bar/ But that dir has a default page "index.htm".So when I accessed the url I only got the default page. Can you tell me is there a way to fetch all the files in that dir?Thanks a lot. -- To u

about die's output

2007-02-12 Thread Jm lists
hello,lists, When I said: die "usage: $0 pub|del"; I got this output: usage: xxx.pl pub|del at xxx.pl line 20. Then when I said: die "usage: $0 pub|del\n"; Only the "\n" was added.The output became: usage: xxx.pl pub|del It lost the words of "at x

what's these warnings?

2007-02-08 Thread Jm lists
Hello, I wrote these codes in my CGI scripts: my $percent = sprintf("%.2f\%",$count/$total * 100); Then I print the $percent to web and get the results correctly like: 12.41% But when I looked at error_log,I got many error warnings: Invalid conversion in sprintf: end of string at /home/apach

post file

2007-02-06 Thread Jm lists
Hello, I have a XML file which needed to be posted to a remote site. I have no idea on how to do it.Can you show me some useful reference?Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Help with URI encode

2007-01-04 Thread Jm lists
Hello members, I'm really confused for all the kinds of uri encoding.Can you please help me again about the uri charset below? http://www.example.com/so/index?key=%BD%F1%C8%D5%C5%C5%D0%D0&viewlist=1 what's the encode format for "%BD%F1%C8%D5%C5%C5%D0%D0" ?Thank you. -- To unsubscribe, e-mail:

What's this string?

2006-12-18 Thread Jm lists
http://search.cn.yahoo.com/search?p=%E9%A3%9E%E8%BD%AE%E6%B5%B7%E6%B5%B7%E6%8A%A5&pid=65226_1006&ei=UTF-8 What's the encode format for the "%E9%A3%9E%E8%BD%AE%E6%B5%B7%E6%B5%B7%E6%8A%A5" in above string?I tried some ways but got nothing. Please help,thanks. -- To unsubscribe, e-mail: [EMAIL PRO

What's these warnings?

2006-12-11 Thread Jm lists
Hello members, When I run: $ perl -c myscript.pl perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.en" are supported and installed on your system. perl: warning: Falling back to

What's this string?

2006-11-28 Thread Jm lists
Hello, Can you tell me what's this string? =?GBK?B?zNSxpszh0NHE+qO6wvS80tLRvq3GwLzbo6zH67vYxsA=?= How to decode it?I try: $ perl -MEncode -le 'print encode("utf8",decode("gbk","=?GBK?B?zNSxpszh0NHE+qO6wvS80tLRvq3GwLzbo6zH67vYxsA=?="))' But I can't get the result correctly. Thanks for your

install libs under private directory

2006-11-15 Thread Jm lists
hello members, I want to install some perl libs under my home dir since I don't have the root privileges. Can you tell me how to do it other than the method of "perl -MCPAN -e shell"?Thanks.

Re: Time format

2006-11-15 Thread Jm lists
Very cool!Thanks. 2006/11/15, Ricardo SIGNES <[EMAIL PROTECTED]>: * Jm lists <[EMAIL PROTECTED]> [2006-11-15T09:57:44] > Hi members, > > I want to get this format of time: > > 11.07.06 12:00 pm > > can you tell me how to get it?(maybe need to be translat

Time format

2006-11-15 Thread Jm lists
Hi members, I want to get this format of time: 11.07.06 12:00 pm can you tell me how to get it?(maybe need to be translated from the 'localtime') Thanks.

Re: reading a big file

2005-07-19 Thread Mailing Lists
Slightly off topic but.. I dont know if this possible with your situation, but it may make more sense to put the growing file into a database and write reports out of the database that extract the needed data. Just a thought from a different point of view. On 7/15/05, Octavian Rasnita <[EMAIL PR

Re: Perl module question

2004-12-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Stephen Liu wrote: > Further to my last posting > $ perl wget_window.pl > Can't locate Tk.pm in @INC (@INC contains: > Tk.pm module still could not be found It can't be found because it didn't install: > t/zzScrolled.FAILED tests 66, 94 ... > /usr/bin/make test -- NOT OK >

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
> Hi again, > Ok, I've got ActiveState on WinXP, 5.8.4 ... I tried and found that I > had the same problems as you. After much playing around, I found it's > a quoting problem on the command line (at least, in my case it was). > I just don't have a good grasp of quoting rules and precedence in D

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I am using Cygwin on Win2K and the version of perl on it is v5.8.0 I am using the same input file, but when I run the command you ran, the output looks like Object1 Description1 Object2 Description2 Object3 Description3 Thanks Errin Larsen wrote: > > Thanks for your help guys... > > > >

Re: Need help with script

2004-09-30 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Paul Johnson wrote: > On Thu, Sep 30, 2004 at 08:00:41AM -0500, Errin Larsen wrote: > > Hi Perlers, > > On 30 Sep 2004 10:11:29 +0100, Jose Alves de Castro > > <[EMAIL PROTECTED]> wrote: > > > On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > > > > perl -l -00pe's/n/t/;s/"//g;' FILENAME >

Need help with script

2004-09-29 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I have a file with the following format Object1 "Description1" Object2 "Description" Object3 "Description" I would like the output in the following format object1<...tab>Description1 object2<...tab>Description2 object3<...tab>Description3 Thanks -- To unsubscribe, e-mail: [EMAIL

Reading hex data from file.

2004-08-18 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, Among other data, a binary file contains the bytes "00A5". I am trying to read these four bytes and get the decimal equivalent as follows: .. $buf; $hex_val; $dec_val; read(FD, $buf, 4); $buf -> "00A5" $hex_val = unpack("H*", $buf); $dec_val = hex($hex_val); ... Is there a way in wh

Modifying @INC

2004-07-29 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I want to add some paths to the @INC array to resolve certain package names at runtime. One of the methods is: "push(@INC,$path) or unshift($path,@INC)" and then say "require package_name;". the problem with this is that we still need to use the "::" operator with the symbols to resolve the packag

Rounding a negative number

2004-07-22 Thread PerlDiscuss - Perl Newsgroups and mailing lists
$item = sprintf("%0.2f", $item); print $item, "\n"; The above code prints -992.99 if $item = -993, while it prints 993.00, if $item = 993. Why is the rounded number off by 0.01 if the number is negative? Thanks, SU -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

different argv behavior in different machines

2004-06-24 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I am a new perl user and I am running into a problem. I am trying to use argv and it's not returning the correct response on my laptop, but it's working fine on another machine. The only difference between the two machines is that on my laptop, I first installed the perl AS package for windows ra

Importing external data into arrays

2004-06-09 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm just a beginner to perl and am having some beginner type problems. I need to import a external file containing 15 character ID numbers (one per record) into an single dimensional array within perl. Later this array will be used to interrogate other data within the program. Can someone out the

How to readline when using "more" option in script.

2004-06-08 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, I could use open(STDOUT,"| more") option to more big file. After this, I close STDOUT as if I do not close, readline prints the prompt even when more is not 100%. ### open(STDOUT,"| more") || "Cannot open stdout for more $!"; $status = system("cat report.tx

How to readline when using "more" option in script.

2004-06-08 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, I could use open(STDOUT,"| more") option to more big file. After this, I close STDOUT as if I do not close, readline prints the prompt even when more is not 100%. ### open(STDOUT,"| more") || "Cannot open stdout for more $!"; $status = system("cat report.tx

Calling "more" in perl script for large files.

2004-06-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
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. But looks loke it is not possible. Any

Extract text between tags

2004-06-02 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I want the extract the text in between the tags from my htm file. I am using below code its not working Please let me know how to proceed further. use Text::Balanced "gen_extract_tagged"; my @queries = ( qq(QUERY = sdf) ); for (@queries) { my ($extracted, $remainder, $prefix) =

Loading Scalar Vars with Text - Readability

2004-06-01 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, Adding Perl to the list of languages... and came across a question of loading vars with very long strings... Actually I am modifiying a prior employee's code and want to make it more readable. currently the code is such: my $longlist = "Clause1|Clause2|Clause3|Clause4|...|ClauseN"; I

Digest:MD5 compilation errors...

2004-05-25 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm trying to install Digest:MD5 2.33 on RHES 3 and getting compilation errors: perl Makefile.PL Perl's config says that U32 access must be aligned. Writing Makefile for Digest::MD5 make Makefile:85: *** missing separator. Stop. Here's a snippet of the Makefile starting with line #85: installma

How do you invoke a Clearcase View?

2004-05-20 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Does anyone know how to call a Clearcase setview from Perl, where you can change directories and move around the vob, and compile files? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

File Monitoring

2004-05-10 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi there, Can anyone recommend a good way to have a perl script that constantly monitors for the creation of new files on UNIX and launches another process? Thanks! Cheers, Ben -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Ntsendmail

2004-05-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, I'm new to this and I'd like to know if anybody knows NTsendmail and how I can add variable that point to a textarea defined in a HTML file? I can run it now but it shows the example text defined in my pl script file. I'd like to replace that message with the content of a textarea of a HTML fi

Re: installing perl module without root permission

2004-04-09 Thread PerlDiscuss - Perl Newsgroups and mailing lists
take a look at http://www.rcbowen.com/imho/perl/modules.html. Specifically he/she writes: If you do not have root permissions on the machine where you want to install the module, such as if you wish to install a module in your home directory, just change one of those commands. Instead of

installing perl module for mysql driver

2004-04-09 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Im trying to install the module DBD::mysql so I can connect to a mysql database from a perl script. The instructions for installing told me to run the command: perl -MCPAN -e 'install Bundle::DBD::mysql' this did its thing, downloaded and unzipped some gz gfiles, etc. Then said everything was ok

Timezone conversion

2004-04-02 Thread Distribution Lists
can someone give me ideas of how I could covert this date and time stamp that is in GMT to Central time ? 2004-04-01-19:15:15.525+00:00 Thanks -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Timezone conversion

2004-04-01 Thread Distribution Lists
can someone give me ideas of how I could convert this date and time stamp that is in GMT to Central time ? 2004-04-01-19:15:15.525+00:00 Thanks -- -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: sort

2004-03-25 Thread lists
On Thu, 25 Mar 2004 [EMAIL PROTECTED] wrote: > any modules out there that can sort things such as.. BB10, > BB1100,BB11. I want it to be in this order. BB10,BB11,BB1100. yeah, if you have 5.8 you can use mergesort from the sorts module use strict; use warnings; # always! use sort '_mergesort

Re: Regular expression to replace whitespace with comma

2004-03-12 Thread Distribution Lists
That worked great! Thanks Darryl > On Mar 12, 2004, at 3:19 PM, Distribution Lists wrote: > >> Thanks but I've that already try that >> >> C:\temp>perl -pi.bak -e "s/\s+/,/g" tempfile.out > > Add the -l switch to that to chomp the newline and replace

[Fwd: Re: Regular expression to replace whitespace with comma]

2004-03-12 Thread Distribution Lists
is missing is that after field 6 there is no comma, but a newline So that it will come out like this Server,Drive,FSTYPE,Size,Free,Used SERVER1,C$,NTFS,4095,296,3799 SERVER2,D$,NTFS,4001,1908,2093 SERVER3,C$,NTFS,38123,29812,8315 > On Mar 12, 2004, at 2:55 PM, Distribution Lists wrote: > &

Regular expression to replace whitespace with comma

2004-03-12 Thread Distribution Lists
Can someone please tell what regular expression would change Server Drive FSTYPE Size Free Used SERVER1 C$ NTFS4095 296 3799 SERVER2 D$ NTFS4001 1908 2093 SERVER3 C$ NTFS 38123 29811 8312 to Server,Drive

Re: PERL concatenating directory names

2004-03-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm on a Windows 2000 environment - and yes, I agree that using the PERL conventions would be best. Unfortunately, there is a specific request for this command to be used in this basic format. I've used the command in a shell script (.sh) and it works fine, but no luck in PERL. If you have any m

PERL concatenating directory names

2004-03-03 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I'm having a problem when redirecting output from a system call to a text file. A good example would be: command.com /c dir /O /a-d /s > dir.txt When I run this directly from the command line I will get the full path structure in the output file. When I call this from a perl script in the form:

Capture/Display a program's output in an ASP page

2004-02-27 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I would like to Capture/Display a program's output in an ASP page. Here's the program:(TestProg.pl) --- print "This line came from my test perl program"; Here is ASP to excute the program that some nice person on this Newgroup gave me. It executes

Perl on WinCE

2004-02-04 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, This is with regard to deploying Perl on Windows CE. My hardware setup consists of an Intel Celeron Processor, an i830M4 chipset Intel motherboard and I am running WindowsCE .Net 4.2 here. The board is targeted at Notebook devices. This is acting as my Windows CE device while I am using a

New Perl User needs help with POST in perl

2004-01-29 Thread PerlDiscuss - Perl Newsgroups and mailing lists
I have written my HTML code to where it uses POST to collect information. Where do I start to write a script that collects the data from the web site, places the input into a dbm file, then places a 1 next to it like an array? Some of the data in the file will have zeros, while the ones that are in

Re: How to call perl programs from ASP page

2004-01-26 Thread PerlDiscuss - Perl Newsgroups and mailing lists
This is what that gets me: Error Type: PerlScript Error (0x80004005) Global symbol "$Server" requires explicit package name > Sounds like perl is not starting automatically. Try this: > my $file_path = $Server->MapPath( "/ASPtoPerl/MakeFile.pl" ); > my $exit_status = system_call

Re: How to call perl programs from ASP page

2004-01-26 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi Charles Still no luck... I tried: system_call_test( 'C:\Inetpub\wwwroot\ASPtoPerl\MakeFile.pl') system_call_test( 'C:/Inetpub/wwwroot/ASPtoPerl/MakeFile.pl') I even moved the File to the "scripts" folder and tried: system_call_test( 'C:\Inetpub\Scripts\MakeFile.pl') Any more ideas ? Thanks f

Re: How to call perl programs from ASP page

2004-01-26 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hey Charles, This is what your script returned Executing this: 'MakeFile.pl' 'system' returned: 'No such file or directory' What's the next step ? Pete -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How to call perl programs from ASP page

2004-01-25 Thread PerlDiscuss - Perl Newsgroups and mailing lists
Hi, I'm new to Perl and I'm trying to excute/call a perl program from Perl Script in an ASP page. I've loaded ActivePerl v5.6 on my Microsoft Win2000 webserver and I can execute lots of Perl code in my ASP pages with no problem, but I need to call an external program and don't know the correct syst

IO File Problems

2004-01-21 Thread PerlDiscuss - Perl Newsgroups and mailing lists
hi there, couse of my missing skills with filehandling i would be happy if you provide me help. this is my problem: 1) I´m getting a list of email adresses (strings) from a database into an array - o.k. no problem ... 2) now i have to merge this strings with strings from a file. in this file th

  1   2   >