I was just going thru some perl tutorial I came across 'h2ph' utility
which converts c header files to .ph files
Ok man h2ph would give this much information , but what is the use of
h2ph. When I have the need of any modules I create Packages and
'require' or 'use'. I never till now required to
print $file . "\n";
Puts to STDOUT (Screen) what is in $file.
Wags ;)
-Original Message-
From: Bob H [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 16:57
To: [EMAIL PROTECTED]
Subject: Expanding a variable
If I have a variable that I used to a regex to populate how c
If I have a variable that I used to a regex to populate how can I now
expand that variable?
Ex:
I have a variable $file that I use a regex to match a file in a
directory and put that match into $file. Now I want to get that info out
of the $file variable and use it in a system() call.
Bob
On Fri, Dec 20, 2002 at 09:13:41PM -, Rob Dixon wrote:
> Please explain about that useful-looking command-line syntax. It looks to be
> equivalent to
>
> use O qw(Deparse -p);
Yep. that's it.
> but I've never heard of module 'O'.
O.pm is the interface to the B compiler modules. In thi
Thank you so much!!! I could not hold to check things for myself.
Satya::Novice_City;
---
Rob Richardson wrote:
>
> I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
> thinking of "$a = [3, 2, 1];", in which an anonymous array would be
> created and $a would return 3, the number of elements in the array.
>
> NOT!!!
>
> The above is what I was going to say when I
Funnily enough, this is exactly where I was a couple of days ago. I think
you are stuck this way if you can only receive e-mail, but if you can
register nntp.perl.org as a NNTP server the just subscribe to the
perl.beginners newsgroup. You'll then get both a 'Reply' and a 'Reply to
Group' toolbar b
Greetings!
A small off-list discussion is included with this message because, as
Rob Dixon says, it is on topic. But that's not the purpose of this
message.
I am using Yahoo Mail to read messages from this group. When I click
the Reply button on a message, the E-mail address that is filled in
"Rob Richardson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Rob,
>
> I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
> thinking of "$a = [3, 2, 1];", in which an anonymous array would be
> created and $a would return 3, the number
Rob,
I will take your word that "$a = (3, 2, 1);" returns 1. I think I was
thinking of "$a = [3, 2, 1];", in which an anonymous array would be
created and $a would return 3, the number of elements in the array.
NOT!!!
The above is what I was going to say when I started typing this, but
then I r
OK first round to you!
Please explain about that useful-looking command-line syntax. It looks to be
equivalent to
use O qw(Deparse -p);
but I've never heard of module 'O'. Is it anything to do with the Powerpuff
Girls' Chemical X?
Puzzled,
/R
"Paul Johnson" <[EMAIL PROTECTED]> wrote in me
Jess Balint wrote:
>
> Hi all. Can anybody tell me why I get a broken pipe on the following? I just
> can figure it out. Thanks.
>
> jess
>
> # Get all possible states from the files
> open( STATES, "sort $hotline |" )
> or cust_die( "Cannot open files to get states
> ($hotline,$newtofi
"John W. Krahn" wrote:
>
> #!/usr/bin/perl -w
> use strict;
> use CGI qw/:standard/;
>
> print header;
>
> my @arrayStuff = (
> { OutFile => 'albu.htm',
> PageId => '3.4.1.5.1',
> Menu=> 'albu_menu.inc',
> Content => 'albu.inc'
> },
> { OutFile => 'armi.php',
>
Actually the form has several checkboxes with the same name. I figured it out though.
The script went through all params in a loop in scalar context so that made that param
a single value.
SO the correct format I found to be
@array $cgi->param('checkbox');
The above does get an array but only
Colin Johnstone wrote:
>
> Gidday all,
Hello,
> I want to create an array and then remove elemnets one at a time and split on the
>comma.
>
> I've tried this with no success..
>
> #!/usr/bin/perl -w
>
> print "Content-Type: text/html\n\n";
>
> my @arrayStuff;
>
> $arrayStuff[0] = "albu.htm
Dan
Dan
Have you generated a checkbox with
$cgi->checkbox (-name => 'checkboxname', ...)
because this will create only an isolated single checkbox. To create a group
of checkboxes use
$cgi->checkbox_group (-name => 'groupname', ...)
which will then return a list of only the _checked_
Hi all. Can anybody tell me why I get a broken pipe on the following? I just
can figure it out. Thanks.
jess
# Get all possible states from the files
open( STATES, "sort $hotline |" )
or cust_die( "Cannot open files to get states
($hotline,$newtofile,$newmover): $!\n" );
while(
Hello,
I'm starting to use CGI.pm to parse input instead of cgi_lib.lib
What I need to do is get the values of a series of checkboxes into an array so I can
do foreach over them .
EXAMPLE :
@check_box_entries = $cgi->param('checkboxname');
$check_box_entries = $cgi->param('checkboxname')
Date sent: Fri, 20 Dec 2002 13:00:59 -0500
From: Ian Zapczynski <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject:how to use alarm() to properly time out a connection?
> I need to use alarm to time out a connection to an SFTP serve
Thanks for your responses.
Regards,
Sugumar
Bob Showalter wrote:
-Original Message-
From: Sugumar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 2:47 PM
To: [EMAIL PROTECTED]
Subject: Redirecting Output
Hi,
I'm trying this command from my perl program system (
"perldoc
>
> eval {
> $sftp = Net::SFTP->new($FTPHOST, user=>$FTPUSER,
> password=>$FTPPASS);
> local $SIG{ALRM} = sub { die "alarm\n" };
> alarm 60;
> };
>
> if ($@) {
> &sendSNMP unless $@ eq "alarm\n";
> }
>
> When I run the test code with the
Jose,
Yes, you are correct. I did not know about placing the alarm prior to
the hanging condition (gee, I guess that makes sense) or clearing the
alarm afterwards. Thank you!
-Ian
NYIMI Jose (BMB) wrote:
-Original Message-
From: Ian Zapczynski [mailto:[EMAIL PROTECTED]]
Sent: Frid
> -Original Message-
> From: Ian Zapczynski [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 7:01 PM
> To: [EMAIL PROTECTED]
> Subject: how to use alarm() to properly time out a connection?
>
>
> Hello all,
>
> I need to use alarm to time out a connection to an SFTP server i
> vec() is a bit squirrelly. In a nutshell (heh), vec views its first
> argument as a stream of bits taken from the string. The third
> argument tells how many bits form a chunk. 8 bits gives chunks that
> can each have values from 0 to 255. The second argument tells *which*
> chunk, numbering
Hello all,
I need to use alarm to time out a connection to an SFTP server if the
connection hangs (I was able to reproduce such a hang using the Secure
Shell Server for Windows, so I thought it would be nice if my script
assumed this was a possibility).
I think I am not understanding the perld
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> Thanks to all,
>
> it working!!!
>
> RobR: for $i,I thinking i need give parameter into table before use
> it.
>
> fi each "ARGV" i put " from ' and it working
>
> the correct script is :
> #!/usr/bin/perl -w
>
> use Mail::Sender;
>
>
> $sende
> "James" == James Kipp <[EMAIL PROTECTED]> writes:
>> vec( $output, length $output, 8 ) = ord "E";
James> is it just me or do others on this list have a tough time understanding the
James> vec() function?
vec() is a bit squirrelly. In a nutshell (heh), vec views its first
argument as a stre
Hi -
After a quick look...
foreach $line(@db) # ...
put a space here ^
foreach $line (@db) # ...
next $line;
no,no,no, the next line is taken care of by for(each) automatically.
my $newQA = ""; # ...
defined as a scalar ($) but you use it as an array
On Fri, 20 Dec 2002 16:31:55 +, Al Lukaszewski <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I'm writing a script that is intended to read in a comma-delimited
> file called "qa.db" line-by-line. Each line is split into fields and
> the first t
Greetings,
I'm writing a script that is intended to read in a comma-delimited
file called "qa.db" line-by-line. Each line is split into fields and
the first two fields are evaluated. The first field is a line
reference; the second is a lemma. If the line reference is the same
as the previous en
Or let it go out of scope, but then it is no longer available to re-add to. This works
well within loops however, where it will be newly initialized.
http://danconia.org
On Sat, 21 Dec 2002 01:32:43 +1100, "Johnstone, Colin"
<[EMAIL PROTECTED]> w
undef %hash;
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 9:33 AM
> To: '[EMAIL PROTECTED]'
> Subject: killing a hash
>
>
> Gidday all,
>
> to kill an array or reset it you do
>
> @arrayname();
>
> how do you reset a has
> -Original Message-
> From: Johnstone, Colin [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 9:33 AM
> To: '[EMAIL PROTECTED]'
> Subject: killing a hash
>
>
> Gidday all,
>
> to kill an array or reset it you do
>
> @arrayname();
Actually, its
@arrayname = ();
>
>
> Here our two reg expr. The first returns all the data I need
> except data
> that starts "~MISC~".
>
> if (/\s+(\w{4,4}00).+\s+([\d,.]+)/){ # $1 = /\w\w\w\w00
> if (/\s+((\w{4,4}00)||~MISC~)).+\s+([\d,.]+)/){ # same
> expression but
> I need it to match if its \w\w\w\w00 or ~MISC~
Well I
Thanks to all,
it working!!!
RobR: for $i,I thinking i need give parameter into table before use it.
fi each "ARGV" i put " from ' and it working
the correct script is :
#!/usr/bin/perl -w
use Mail::Sender;
$sender = new Mail::Sender
{smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'} o
got it. I only need one set of () and only |.
> -Original Message-
> From: Paul Kraus [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002 9:30 AM
> To: 'Perl'
> Subject: REGEXP help asap :)
> Importance: High
>
>
> I have a 23,000 accounting error I have to find before 12
> wh
> -Original Message-
> From: Sugumar [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 19, 2002 2:47 PM
> To: [EMAIL PROTECTED]
> Subject: Redirecting Output
>
>
> Hi,
>
> I'm trying this command from my perl program system (
> "perldoc perldsc >
> tmp.txt"). I don't see the output
Gidday all,
to kill an array or reset it you do
@arrayname();
how do you reset a hash
%hashname;
Regards
Colin Johnstone
I have a 23,000 accounting error I have to find before 12 when my boss
comes in or one of my employees is going to get reamed. To but it
nicely.
Here our two reg expr. The first returns all the data I need except data
that starts "~MISC~".
if (/\s+(\w{4,4}00).+\s+([\d,.]+)/){ # $1 = /\w\w\w\w00
>
> #!/usr/bin/perl
>
> use Mail::Sender;
> $i = scalar (@ARGV);
>
> $sender = new Mail::Sender
> {smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'};
> $sender->MailFile({to => '[EMAIL PROTECTED]',
>subject => '$arg[0]',
>msg => "$arg[1]",
>
in shell scripts you get arguments in $1 $2 $3 etc
similarly in perl scripts you get $ARGV[0] ( starts from 0 ) $ARGV[1] etc
[EMAIL PROTECTED] wrote:
hi,
i'm newbie in perl language and i need help.
I search from 3 days how give parmeter ti perl script same as shell script.
If someone can he
On Fri, Dec 20, 2002 at 03:10:16PM +0100, [EMAIL PROTECTED] wrote:
> #!/usr/bin/perl
>
> use Mail::Sender;
> $i = scalar (@ARGV);
>
> $sender = new Mail::Sender
> {smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'};
> $sender->MailFile({to => '[EMAIL PROTECTED]',
>subjec
Damien,
Where is the "arg" array being populated? If you replace "arg" with
"ARGV" in your call to MailFile then maybe it would work. You'd also
have to replace the single quotes with double quotes. If you use
single quotes, you just get the string between the quotes. If you use
double quotes,
Thanks,
the script is the following:
#!/usr/bin/perl
use Mail::Sender;
$i = scalar (@ARGV);
$sender = new Mail::Sender
{smtp => 'server.smtp.com', from => '[EMAIL PROTECTED]'};
$sender->MailFile({to => '[EMAIL PROTECTED]',
subject => '$arg[0]',
msg => "$arg
do you mean command line parameters?
for that, you manipulate the @ARGV array. or you could use one of the getopt
modules.
let us know what you are trying to do and we will help you
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 20, 2002
Parameters on the command line are stored automagically by Perl in the @ARGV array.
You may also want to check out the standard GetOpt modules.
http://danconia.org
On Fri, 20 Dec 2002 14:37:55 +0100, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrot
No, it's not hard. vec and ord are simply used for translating ASCII
characters to their corresponding characters, well, let's say, numbers.
Say like %20 represents a space. Anyway, check out:
perldoc -f vec
perldoc -f ord
It's really simple :)
--
Bob Erinkveld (Webmaster Insane Hos
hi,
i'm newbie in perl language and i need help.
I search from 3 days how give parmeter ti perl script same as shell script.
If someone can help me?
thanks
Damien
-
SPECIAL ADSL
L'ADSL Tiscali est à partir de 15,95 EUR/mois ! Plus modem ADSL et frais d'activation
gratuits !
Pour
> vec( $output, length $output, 8 ) = ord "E";
is it just me or do others on this list have a tough time understanding the
vec() function?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Fri, Dec 20, 2002 at 12:11:42PM -, Rob Dixon wrote:
> We make a good team Paul ;-}
:-)
But you do actually need the parens in the index call, otherwise the
precedence is wrong:
$ perl -MO=Deparse,-p -e '@match = grep { index $_, $string >= 0 and $_ ne $string }
@array;'
(@match = grep({
If you haven't seen it yet, O'Reilly has a wonderful tongue-in-cheek
article titled "How Perl Powers Christmas".
http://www.perl.com/pub/a/2002/12/18/hohoho.html
Rick
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
We make a good team Paul ;-}
"Paul Johnson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I don't know about better, but why not code it exactly as you describe
> it?
>
> @match = grep { index($_, $string) >= 0 and $_ ne $string } @array;
>
> This has the
I don't know too much about redirecting output in Unix, but whatever will
work on the command line should work in system(). Within perl, you can
achieve the same effect with:
open TMP, "> tmp.txt";
print TMP foreach `perldoc perldsc`;
close TMP;
HTH,
Rob
"Sugumar" <[EMAIL PROTECTED
On Fri, Dec 20, 2002 at 05:00:04PM +0530, Ramprasad wrote:
> hello all
>
> Assume the foll
>
> $string='mail.com';
> @array=qw(mail.com one.mail.com two.mail.com mail.com/one mail1.com);
>
> @match = grep{..}@array;
>
> I want to match all that *contain* $string but is not equal to $string
>
Ramprasad
Yours isn't a general solution anyway, as any periods in your string will
match any character in a list entry. I would use the plainer:
@match = grep { index $_, $string >= 0 and $_ ne $string } @array;
Cheers,
/R
"Ramprasad" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED
From: [EMAIL PROTECTED]
>
> On Thu, 19 Dec 2002 17:44:22 +0100, "Jenda Krynicky"
> <[EMAIL PROTECTED]> wrote:
>
> > This is:
> > sub createClosure {
> > my $x = shift;
> > return sub { print $x++,"\n" }
> > }
> >
> >
hello all
Assume the foll
$string='mail.com';
@array=qw(mail.com one.mail.com two.mail.com mail.com/one mail1.com);
@match = grep{..}@array;
I want to match all that *contain* $string but is not equal to $string
so I came up with
@match = grep{/^$string.+/ || /.+$string$/} @array;
is there
Hi Colin
You may prefer this:
$line =~ s/[\d\s()]+$//g;
which will remove all trailing whitespace, digits and parentheses from
string $line.
Rob
"Colin Johnstone" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Gidday All,
>
> Im reading course names in
Thank You Ramprasad,
Silly me, the previous time I used this regex the fileds were tab delimited. It's been
a long day her in Sydney Town, my concentration is starting to waver.
Regards
Colin
-Original Message-
From: Ramprasad [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 200
just one mistake in the code
Your elements are comma seperated and you are doing
@data = split( /\t/, $element);
do a
@data = split( /,/, $element);
-
Ram
Colin Johnstone wrote:
Gidday all,
I want to create an array and then remove elemnets one at a time and split on the comma.
I've t
Gidday all,
I want to create an array and then remove elemnets one at a time and split on the
comma.
I've tried this with no success..
#!/usr/bin/perl -w
print "Content-Type: text/html\n\n";
my @arrayStuff;
$arrayStuff[0] = "albu.htm,3.4.1.5.1,albu_menu.inc,albu.inc";
$arrayStuff[1] = "armi.
61 matches
Mail list logo