The program begins
#!/usr/bin/perl
use Tie::File;
use File::Copy 'copy';
use File::Spec;
my $copy=00-copy.htm;
my $recapfile=00recap.txt;
my $htmfile=00.htm;
my $ct;
tie my @bfile, 'Tie::File', $recapfile or die cannot tie recapfile and
bfile $!;
tie my @hfile, 'Tie::File', $copy
On Aug 6, 2014, at 10:55 AM, ESChamp wrote:
The program begins
#!/usr/bin/perl
You really should add these two lines:
use strict;
use warnings;
here and correct the mistakes they reveal.
use Tie::File;
use File::Copy 'copy';
use File::Spec;
my $copy=00-copy.htm;
my
Hi,
I'm trying to (learn how to) create a mega-widget in Perl/Tk and am hacking
some examples from Mastering Perl/Tk. I apparently do not understand how to
use ConfigSpecs. I'm trying to be able to pass arguments to the widget
constructor and define default values if the arguments are not
Cort Morgan wrote:
I'm trying to (learn how to) create a mega-widget in Perl/Tk and am hacking
some examples from Mastering Perl/Tk. I apparently do not understand how to
use ConfigSpecs. I'm trying to be able to pass arguments to the widget
constructor and define default values if the
Li, Jialin wrote:
On Sun, Apr 27, 2008 at 7:28 AM, J. Peng [EMAIL PROTECTED] wrote:
On Sun, Apr 27, 2008 at 2:52 AM, hotkitty [EMAIL PROTECTED] wrote:
This is my first experience w/ PERL and I've searched everywhere but
haven't found the answer. As an example, how do I simply open a
Rob Dixon wrote:
WWW::Mechanize is a subclass of LWP::Useragent
Apologies - that should be LWP::UserAgent
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
This is my first experience w/ PERL and I've searched everywhere but
haven't found the answer. As an example, how do I simply open a
webpage (www.bloomberg.com) then click on each link within that
webpage that contains Calpers Chief Buenrostro and then click on
each link in that link that contains
Have you tried the Perl Module LWP ? You can do conditionals and get
LWP to do a lot of that for you.
--j
On Apr 26, 2008, at 2:52 PM, hotkitty wrote:
This is my first experience w/ PERL and I've searched everywhere but
haven't found the answer. As an example, how do I simply open a
On Sun, Apr 27, 2008 at 2:52 AM, hotkitty [EMAIL PROTECTED] wrote:
This is my first experience w/ PERL and I've searched everywhere but
haven't found the answer. As an example, how do I simply open a
webpage (www.bloomberg.com) then click on each link within that
webpage that contains
From my experience, Mechanize is much easier to use than LWP.
On Sun, Apr 27, 2008 at 7:28 AM, J. Peng [EMAIL PROTECTED] wrote:
On Sun, Apr 27, 2008 at 2:52 AM, hotkitty [EMAIL PROTECTED] wrote:
This is my first experience w/ PERL and I've searched everywhere but
haven't found the answer.
On Nov 21, 2:33 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
Francois wrote:
I tried to get data from a site which use cookies and redirect the
user, I spend a lot of time with the same result: connection timed out
until I realised that all was fine if I did'nt send the header...
Thanks for
I tried to get data from a site which use cookies and redirect the
user, I spend a lot of time with the same result: connection timed out
until I realised that all was fine if I did'nt send the header...
Thanks for any explanations !!!
Francois
here is my code:
use strict;
use warnings;
On 11/20/07, Francois [EMAIL PROTECTED] wrote:
what's wrong with my http header
You may get a faster, better answer if you ask in a forum concerning
http headers and related topics; this forum is for Perl beginners.
I realised that all was fine if I did'nt send the header...
So, everything
Francois wrote:
I tried to get data from a site which use cookies and redirect the
user, I spend a lot of time with the same result: connection timed out
until I realised that all was fine if I did'nt send the header...
Thanks for any explanations !!!
Francois
here is my code:
use strict;
What's wrong with this script for removing the CVS directories from a
checked-out CVS
workspace?
#!/usr/bin/perl
use strict;
use warnings;
my $mypath = '/Users/emac/gcc';
removecvs( $mypath);
sub removecvs {
my $path = $_[0];
system ('/bin/rmdir',$path/CVS) or die Can't
On 11/5/06, Tommy Nordgren [EMAIL PROTECTED] wrote:
What's wrong with this script for removing the CVS directories from a
checked-out CVS workspace?
I don't know. What do you think is wrong with it? Does it do something
wrong? Does stepping through it with the debugger give you any clues
the files in it, then call rmdir() on the CVS
directory.
Try sticking print statements in it to try to see where it's hanging.
HTH,
- Travis.
Tommy Nordgren [EMAIL PROTECTED] wrote:
What's wrong with this script for removing the CVS directories from a
checked-out CVS
workspace?
#!/usr
Tommy Nordgren wrote:
What's wrong with this script for removing the CVS directories from a
checked-out CVS workspace?
Are you asking because it is not working correctly?
#!/usr/bin/perl
use strict;
use warnings;
my $mypath = '/Users/emac/gcc';
removecvs( $mypath);
sub removecvs
Hi,
I am trying to read a UTF-8 coded file, decode its html character entities,
and print it into another UTF-8 coded file.
The program works fine if I write the line:
$t++; last if $t 200;
If I comment that line (for parsing the entire file, and not only the first
200 lines), the program
On 10/30/06, Octavian Rasnita [EMAIL PROTECTED] wrote:
I am trying to read a UTF-8 coded file, decode its html character entities,
and print it into another UTF-8 coded file.
The program works fine if I write the line:
$t++; last if $t 200;
What is the largest value you can use, instead
Just out of curiosity what kind of cards are you using that you can change
the MAC address ??
Mark
- Original Message -
From: Nikolay Hristakiev [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, May 30, 2003 12:36 AM
Subject: Can someone find out what's wrong ?
I've got a script
I've got a script who looks for change of a MAC-address on
LAN cards of my clients and put it in a fail if there is a
change.
Firts I made static ARP table in /etc/ehters it looks like this
-
mac address hostname
mac address hostname
-
Afer this make arp -s -f
and this is
Nikolay Hristakiev [EMAIL PROTECTED] wrote:
:
: That is it.
: Sorry 4 my broken english
: For me seems everything to be Ok but it's not working :
Define not working. Is it giving you an error? Why
not share it with us? Is it producing a result you don't
expect? Is it producing more than you
On Thu, 15 Aug 2002, Priss wrote:
I have amended the first few lines, this works but I
wonder if this bad...
Priss
while ()
{
/(\S+)/
and $seen_in_file1{$1} += 1;
If the line that is being read is of the form
word1 word2
$1 will only contain 'word1'. \S
# compares lines in 2 files, shows set difference
# call as: myprog file1 file2
while ()
{
/(\S+)/ and $seen_in_file1{$1} = +1;
Did you mean $seen_in_file1{$1} += 1;
When you give the diamond operator it tries to open
all you command
line args as files one after the
I have amended the first few lines, this works but I
wonder if this bad...
Priss
while ()
{
/(\S+)/
and $seen_in_file1{$1} += 1;
push @tmp, $_;
}
open (FILE, @tmp);
while (FILE)
--- Priss [EMAIL PROTECTED] wrote:#
compares lines in 2 files, shows
you never executed the SQL statment
$sth-execute();
-Original Message-
From: Soheil Shaghaghi [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 27, 2002 2:05 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: What's wrong with this code?
Hi everyone,
Can anyone please tell me
See inline comment.
Soheil Shaghaghi wrote:
Hi everyone,
Can anyone please tell me what the problem is with this code?
Every time I run my program with this code in it, I get an error in the log
files:
DBD::mysql::st fetchrow_array failed: fetch() without execute() at
IWeb/sqlengine.pm
Hi everyone,
Can anyone please tell me what the problem is with this code?
Every time I run my program with this code in it, I get an error in the log
files:
DBD::mysql::st fetchrow_array failed: fetch() without execute() at
IWeb/sqlengine.pm line 3395.
sub SQL_Is_Sponsor {
my ($link_id) =
Hi everyone,
Can anyone please tell me what's wrong with this code?
When I try to submit the form, it just reloads the page.
It never gets to the sub addreport
Thanks so much.
#!/usr/bin/perl
# Locate and load required files
eval {
# Get the script location (for UNIX and Windows
note)
Soheil Shaghaghi wrote:
Hi everyone,
Can anyone please tell me what's wrong with this code?
When I try to submit the form, it just reloads the page.
It never gets to the sub addreport
Thanks so much.
#!/usr/bin/perl
# Locate and load required files
eval {
# Get the script
open(text,text.txt) or die (error: text.txt failed\n); #line
17
while(text)
{
print $_;
}
close(text) or die(error: close text.txt failed\n); #line
22
bash-2.05$ perl -Tcw index.pl
Unquoted string text may clash
PROTECTED]
- Original Message -
From: Kyle Babich [EMAIL PROTECTED]
To: beginners-cgi [EMAIL PROTECTED]
Sent: Monday, July 01, 2002 12:22 PM
Subject: What's wrong with this?
Quer ter seu próprio endereço na Internet?
Garanta já o seu e ainda ganhe cinco e-mails
Ok, thank you, but now I'm having another problem with this:
open(TEXT,text.txt) or die (error: text.txt failed\n);
while (TEXT) {
my $text = TEXT;
}
close(TEXT) or die(error: close text.txt failed\n);
print EndOfHTML;
$text
EndOfHTML
It tells me $text
open(TEXT,text.txt) or die (error: text.txt failed\n);
while (TEXT) {
my $text = TEXT;
}
It tells me $text requires explicit package name but I do give it 'my'
so why is it still giving me that error?
The $text has fallen out of scope. Lexical variables
]
- Original Message -
From: Kyle Babich [EMAIL PROTECTED]
To: beginners-cgi [EMAIL PROTECTED]
Sent: Monday, July 01, 2002 1:36 PM
Subject: Re: What's wrong with this?
Quer ter seu próprio endereço na Internet?
Garanta já o seu e ainda ganhe cinco e-mails personalizados
Could someone tell me why this doesn't retrieve my cookie?
The cookie has already been set by another page and I just want to retrieve
it
#!/usr/bin/perl
use CGI param, header,cookie;
print header();
print header(-cookie='MY_COOKIE');
On Sun, Mar 03, 2002 at 07:20:35AM -0500, [EMAIL PROTECTED] wrote:
Could someone tell me why this doesn't retrieve my cookie?
use CGI param, header,cookie;
print header();
print header(-cookie='MY_COOKIE');
header() is for generating an http header, not for reading from it.
print
If you want to loop over all the form fields, you'd do:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which returns a hash.
use CGI;
my $q = CGI-new;
$data =
On Thursday 31 January 2002 11:45 am, you wrote:
If you want to loop over all the form fields, you'd do:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which
Hi !
Sorry for the previous posting, im not yet completely awake ;o)
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which returns a hash.
use CGI;
my $q = CGI-new;
$data = $q-Vars;
print $data-{field}; # etc.
Just a little add
Hi, Gary !
On Thursday 31 January 2002 12:16 pm, you wrote:
Thanks, I tried and didn't understand it.
Dit it work at all ?
I think %data = $q-vars would be better to read and I'm not sure if the
Vars() function returns a reference or a hash.
Ok, i'll try
A hash is a data comfortable
On Jan 31, Gary Hawkins said:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which returns a hash.
use CGI;
my $q = CGI-new;
$data = $q-Vars;
print
--- Jan Gruber [EMAIL PROTECTED] wrote:
Hi !
Sorry for the previous posting, im not yet completely awake ;o)
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which returns a hash.
use CGI;
my $q = CGI-new;
$data = $q-Vars;
using the Perl4 cgi-lib.pl. However, I can think of no other
legitimate use. Here's a nice,
clean method of dealing with this:
use strict;
use CGI qw/:standard/;
my %form_data = map { $_, get_data($_) } param;
sub get_data
{
my $name = shift;
my
If you want to loop over all the form fields, you'd do:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
I'm working with a script that uses a lot of $data{'each_thing'} from %data. I
tried replacing all instances with
On Jan 29, Gary Hawkins said:
If you want to loop over all the form fields, you'd do:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
CGI.pm has a Vars() method, I believe, which returns a hash.
use CGI;
my $q =
If you want to loop over all the form fields, you'd
do:
for $field (param()) {
print $field = , param($field), br\n;
}
How can the param's be placed into a new hash?
my %hash = param();
since param() detects whether it's in list/array/hash
context and does the Right
On Jan 29, Jonathan E. Paton said:
How can the param's be placed into a new hash?
my %hash = param();
since param() detects whether it's in list/array/hash
context and does the Right Thing.
These is no such thing as hash context or array context. There is
void context, scalar context, and
On Tue, 29 Jan 2002, Jeff 'japhy' Pinyan wrote:
On Jan 29, Jonathan E. Paton said:
How can the param's be placed into a new hash?
my %hash = param();
since param() detects whether it's in list/array/hash
context and does the Right Thing.
These is no such thing as hash context or
Jorge Goncalvez wrote:
Hi, I have this:
#!/usr/local/bin/perl -w
use Win32::Registry;
my $Register =Software;
#my $Register2=.DEFAULT\\Software;
my $hkey;
my @array= qw($HKEY_LOCAL_MACHINE $HKEY_CURRENT_USER ) ;
foreach (@array)
i don't know this windows module but i guess this
A good mailing list to check out for Win32 Perl questions is the
perl-ntadmins list at topica.com.
-Original Message-
From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 8:13 AM
To: Jorge Goncalvez
Cc: [EMAIL PROTECTED]
Subject: Re:What's wrong with
Hi everybody!
The next script runs looks pefectly in IE but in Netscape it shows the
source of the html...
#!c:/perl/bin/perl.exe
# recibe la forma.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//, $buffer);
# inicia variables.
$to = info\@domain.mx;
$from = info\@domain.mx;
On Jan 24, Eduardo Cancino said:
The next script runs looks pefectly in IE but in Netscape it shows the
source of the html...
That is because IE does things that a browser should not do.
# recibe la forma.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(//, $buffer);
Ugh. You
From: Eduardo Cancino [EMAIL PROTECTED]
Hi everybody!
The next script runs looks pefectly in IE but in Netscape it shows the
source of the html...
A again the stupid M$IE looks like its working even though it
should scream ...
lotsa code snipped
# imprime html.
???
Thanks everybody...
Lalo.
- Original Message -
From: Jeff 'japhy' Pinyan [EMAIL PROTECTED]
To: Eduardo Cancino [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, January 24, 2002 10:39 PM
Subject: Re: What's wrong with this?
On Jan 24, Eduardo Cancino said:
The next script
On Jan 24, Eduardo Cancino said:
Japhy, may i call u that way?, in this part...
Yes, the name japhy is fine -- I prefer its usage as my internet
persona, or whatever you'd like to call it. It's easier to remember than
my real name, at any rate.
# inicia variables.
$to = info\@domain.mx;
Hello Tirthankar,
Tuesday, December 04, 2001, Tirthankar C. Patnaik [EMAIL PROTECTED] wrote:
TCP You might want to check the permissions of those files.
TCP The command works fine here.
TCP But I guess the mistake is that you're working on Windows, and there you have
TCP a back-slash ( \ )
Hi Maxim,
no :) you forgot to escape backslash. but there is no difference
between \ and / slashes in path names in perl for windows.
Thanks for this. I use perl on a Linux box, and there I use a /.
second, unlink $_path/* does not works.
No. here's a small perl prog I wrote to test
Hello Tirthankar,
Tuesday, December 04, 2001, Tirthankar C. Patnaik [EMAIL PROTECTED] wrote:
TCP Hi Maxim,
no :) you forgot to escape backslash. but there is no difference
between \ and / slashes in path names in perl for windows.
TCP Thanks for this. I use perl on a Linux box, and there
because $_ contains the index number only
you need to access the element of the array!!!
-label=$_boards[$_],
-value =$_boards[$_],
Etienne
Jorge Goncalvez wrote:
Hello, i have this:
open (IPCONF, $_Globals{IPCONFIG}) or die je ne peux ouvrir
$_Globals{IPCONFIG} :$!;
On Thu, 8 Nov 2001, Etienne Marcotte wrote:
because $_ contains the index number only
you need to access the element of the array!!!
-label=$_boards[$_],
-value =$_boards[$_],
No, actually, $_ contains the actual item from the array as used in a
foreach loop like this.
The radio button
oops
my bad
it's the third time he posts his code and it's different each time :P
The one before was for(0..$#array)
that's why I told it was the index
Etienne
Brett W. McCoy wrote:
On Thu, 8 Nov 2001, Etienne Marcotte wrote:
because $_ contains the index number only
you need to
-Original Message-
From: Jon Grant [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 3:32 PM
To: [EMAIL PROTECTED]
Subject: HELP!!! What's wrong with my app.??
Hi all,
I am a perl beginner and find myself somewhat stuck, please help!!
I am trying to write a program
Jon,
This is one way of doing it:
use CGI;
use CGI::Carp qw(fatalsToBrowser);
$query=new CGI;
print $query-header();
print $query-start_html( -title='tt' );
print $query-startform( -method='POST', -name ='tt');
local( *LOGFILE );
$j = 0;
open( LOGFILE, logfile.txt ) or
22 while (IF) {
23 if (/$LOCTAG/i) {
24 ($curloc) = /VALUE=([^]+)\s*\w*/i;
25 $location .= ${curloc}::;
26 }
27
28 if (/$TYPETAG/i) {
29 ($curtype) = /VALUE=([^]+)/i;
30 $jobtype .= ${curtype}::;
31 }
On May 8, Anshu Anshu said:
22 while (IF) {
23 if (/$LOCTAG/i) {
24 ($curloc) = /VALUE=([^]+)\s*\w*/i;
25 $location .= ${curloc}::;
26 }
27
28 if (/$TYPETAG/i) {
29 ($curtype) = /VALUE=([^]+)/i;
30 $jobtype .=
On May 8, John Joseph Trammell said:
On Tue, May 08, 2001 at 05:24:10PM -0400, Anshu Anshu wrote:
22 while (IF) {
23 if (/$LOCTAG/i) {
24 ($curloc) = /VALUE=([^]+)\s*\w*/i;
25 $location .= ${curloc}::;
26 }
27
28 if (/$TYPETAG/i)
in substitution (s///) at gen_job.pl line 35.
Thanks
AS
- Original Message -
From: Jeff Pinyan [EMAIL PROTECTED]
To: Anshu Anshu [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, May 08, 2001 5:28 PM
Subject: Re: what's wrong in systax
On May 8, Anshu Anshu said:
22 while
running at large. - http://dumblaws.com/
-Original Message-
From: Jos I Boumans [mailto:[EMAIL PROTECTED]]
Sent: Wed 9 May 2001 09:05
To: Anshu Anshu; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: what's wrong in systax
from the error msg i conclude that line 29 is not producing
70 matches
Mail list logo