Hi ,
I want to redirect to a different url with the parameters in the post
method.
Any help is appreciated.
Thanks in advance,
Praveena
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:
my $content = do { local $/; <$file> };
That idiom uses an extra buffer, as big as the file.
my $content; { local $/; $content = }
Or:
read( FH, my $content, -s FH ) == -s FH or warn "Could not read the entire
file.\n";
John
2007/8/25, Randal L. Schwartz <[EMAIL PROTECTED]>:
> > ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes:
>
> "Jeff> Also sometime we can use map to do some flexible translation,like
> "Jeff> Schwartz Translation.
>
> That's a new one for me. Are you trying to say "Schwartzian Transform"?
>
Y
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes:
"Jeff> Also sometime we can use map to do some flexible translation,like
"Jeff> Schwartz Translation.
That's a new one for me. Are you trying to say "Schwartzian Transform"?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. -
the simple way is to use shell command 'unix2dos'.
$ unix2dos file.txt
2007/8/25, Yoyoyo Yoyoyoyo <[EMAIL PROTECTED]>:
> Hi all,
>
> I use a mac and I was wondering if there was a way to convert unix newlines
> in a text file to dos newlines.
>
> Robert
>
>
> -
> B
Hi all,
I use a mac and I was wondering if there was a way to convert unix newlines in
a text file to dos newlines.
Robert
-
Boardwalk for $500? In 2007? Ha!
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
Both map and foreach can do the same thing,though they're used in
different syntax environment.
I follow a rule,if you need to return a result list,use map.Otherwise
use for/foreach.
Also sometime we can use map to do some flexible translation,like
Schwartz Translation.
2007/8/25, Dan Sopher <[EM
2007/8/24, Mr. Shawn H. Corey <[EMAIL PROTECTED]>:
> Tom Phoenix wrote:
> > Do you spell it initialised or initialized?
>
> Yes.
>
> british-english: initialise
> american-english: initialize
>
But why not just spell it as init?for us both initialise and
initialize are complicated,I can't remem
Stephen Kratzer wrote:
On Friday 24 August 2007 08:57:26 Marian Bednar wrote:
I am a newbie in this forum and Perl too ;-)
I am trying writing script transfering files using module
Net::SFTP::Foreign.
I need to retrieve from remote directory only names of files (not
directories, links,etc.).
Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:
Dr.Ruud:
Gunnar Hjalmarsson:
my $content = do { local $/; <$file> };
That idiom uses an extra buffer, as big as the file.
my $content; { local $/; $content = }
Does it? In that case, why is it mentioned at
http://faq.perl.org/perlfa
Kirk Wythers wrote:
Sorry for the "not sure where to even begin" nature of this email, but I
am stuck. I am trying to put together a aggregating script that takes
daily climate data and produces monthly averages. For example, the input
file has the form:
year monthdoytmax tmin par
Dan Sopher wrote:
Aside from the syntax, is there a difference in the way 'map' and
'foreach' process?
Hi Dan
Internally they're very similar, but you shouldn't be thinking like that.
As Randal said, foreach is a statement - a language construct like 'if',
'while', 'else' and so on - while m
On 8/24/07, Dan Sopher <[EMAIL PROTECTED]> wrote:
> Aside from the syntax, is there a difference in the way 'map' and
> 'foreach' process?
snip
There are many differences, in addition to what has already been said
map can be more or less cpu efficient than depending on the task*. If
you can use m
On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Xavier Noria wrote:
> > On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote:
> >
> >> "Chas Owens" schreef:
> >>
> >>> [$db_initiali.ed]
> >>> Unless you have some funky source filter installed that normalizes
> >>> spelling variants Perl is going
On 8/24/07, Xavier Noria <[EMAIL PROTECTED]> wrote:
> On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote:
>
> > "Chas Owens" schreef:
> >
> >> [$db_initiali.ed]
> >> Unless you have some funky source filter installed that normalizes
> >> spelling variants Perl is going to have a problem.
> >
> > Yes, I lik
On Aug 24, 1:12 pm, [EMAIL PROTECTED] (Yoyoyo Yoyoyoyo) wrote:
> Hi all,
>
> I am using the diamond operator to redirect input to my perl script. I want
> to copy all of the input on to a single variable using the following
> subroutine:
>
> sub getfile # Copies the file redirected to this perl
On Aug 24, 2:21 pm, [EMAIL PROTECTED] (Dan Sopher) wrote:
> Aside from the syntax, is there a difference in the way 'map' and
> 'foreach' process?
foreach is just a loop. map returns values. Specifically, it returns
the value of the BLOCK/EXPR for each iteration of the loop.
my @doubles = map {
> ""Dan" == "Dan Sopher" <[EMAIL PROTECTED]> writes:
"Dan> Aside from the syntax, is there a difference in the way 'map' and
"Dan> 'foreach' process?
Yes. map is an expression. foreach is a statement. foreach can't
be nested inside a larger expression. map is *meant* to do that,
and using
Xavier Noria wrote:
On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote:
"Chas Owens" schreef:
[$db_initiali.ed]
Unless you have some funky source filter installed that normalizes
spelling variants Perl is going to have a problem.
Yes, I like the idea:
use autocorect;
I think there's an Acme::
On 8/24/07, Kirk Wythers <[EMAIL PROTECTED]> wrote:
snip
> This is part of what was confusing me. I didn't see %totals declared
> anywhere is the suggestion.
snip
Yeah, you can only tell it is a hash because of how it is used. I
believe the person who posted the example expected you to know what
On Aug 24, 2007, at 8:13 PM, Dr.Ruud wrote:
"Chas Owens" schreef:
[$db_initiali.ed]
Unless you have some funky source filter installed that normalizes
spelling variants Perl is going to have a problem.
Yes, I like the idea:
use autocorect;
I think there's an Acme:: module that did somet
"Chas Owens" schreef:
> Dr.Ruud:
>> [my %totals;]
>> Put
>> print Dumper $totals;
>> at the end of the code.
>
> Shouldn't that be
>print Dumper \%totals;
Yes, thanks for the correction.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addition
Thank you very much for the explanation Chas. It is starting to make
more sense. The reason I was attracted to the solution
#! /usr/bin/perl -w
use strict;
use warnings;
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
my ( $year, $month, $doy, $tmax, $tmin, $
Aside from the syntax, is there a difference in the way 'map' and
'foreach' process?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
"Chas Owens" schreef:
> [$db_initiali.ed]
> Unless you have some funky source filter installed that normalizes
> spelling variants Perl is going to have a problem.
Yes, I like the idea:
use autocorect;
(which of course corrects that line last, to signal that it's done)
--
Affijn, Ruud
"Ge
On 8/24/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Kirk Wythers schreef:
> > Gunnar Hjalmarsson:
> >> Kirk Wythers:
>
> >>> I don't see how $totals{$year}{$month}{count} ++; is holding the
> >>> count.
> >>
> >> Read about the auto-increment operator in "perldoc perlop".
> >
> > OK. I'll try and be
Yoyoyo Yoyoyoyo wrote:
Is there anyway to add the End of file marker to the variable before I
print it, so I don't have to do ctrl-d?
The control-D is part of the shell, not Perl. You didn't say so but from your
message I assume that this did the trick. In other words, you are not
redirecti
Gunnar Hjalmarsson schreef:
> Dr.Ruud:
>> Gunnar Hjalmarsson:
>>> my $content = do { local $/; <$file> };
>>
>> That idiom uses an extra buffer, as big as the file.
>>
>>my $content; { local $/; $content = }
>
> Does it? In that case, why is it mentioned at
> http://faq.perl.org/perl
Kirk Wythers schreef:
> Gunnar Hjalmarsson:
>> Kirk Wythers:
>>> I don't see how $totals{$year}{$month}{count} ++; is holding the
>>> count.
>>
>> Read about the auto-increment operator in "perldoc perlop".
>
> OK. I'll try and be more clear to the degree of my ignorance. First,
> I do not unde
On 8/24/07, Kirk Wythers <[EMAIL PROTECTED]> wrote:
>
> On Aug 23, 2007, at 11:17 PM, Gunnar Hjalmarsson wrote:
>
> > Kirk Wythers wrote:
> >> I don't see how $totals{$year}{$month}{count} ++; is holding the
> >> count.
> >
> > Read about the auto-increment operator in "perldoc perlop".
>
> OK. I'
On 8/24/07, Yoyoyo Yoyoyoyo <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am using the diamond operator to redirect input to my perl script. I want
> to copy all of the input on to a single variable using the following
> subroutine:
>
> sub getfile # Copies the file redirected to this perl script
Yoyoyo Yoyoyoyo wrote:
Hi all,
I am using the diamond operator to redirect input to my perl script. I want to
copy all of the input on to a single variable using the following subroutine:
sub getfile # Copies the file redirected to this perl script to the varialbe $x
{
my $x;
local $/ =
Hi all,
I am using the diamond operator to redirect input to my perl script. I want to
copy all of the input on to a single variable using the following subroutine:
sub getfile # Copies the file redirected to this perl script to the varialbe $x
{
my $x;
local $/ = undef;
$x = <>;
retur
On Aug 23, 2007, at 11:17 PM, Gunnar Hjalmarsson wrote:
Kirk Wythers wrote:
I don't see how $totals{$year}{$month}{count} ++; is holding the
count.
Read about the auto-increment operator in "perldoc perlop".
OK. I'll try and be more clear to the degree of my ignorance. First,
I do not
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes:
"Jeff> Yes some Stonehenge teachers are on this list like Tom Phoenix,Randal
"Jeff> etc.From their replied messages you could also see they are a great
"Jeff> Perl training organization.
*blush*
--
Randal L. Schwartz - Stonehenge Consulti
> "Justin" == Justin The Cynical <[EMAIL PROTECTED]> writes:
Justin> The Llama presents hashes as single value to a key, so I never thought
Justin> to make a hash of arrays.
That's because (a) an arrayref is still a single value, so we haven't really
lied, so much as just simplified to what c
On Aug 24, 9:55 am, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
> Paul Lalli wrote:
> > 'our', like 'my', is lexically scoped. Its effects are terminated
> > when the innermost enclosing block ends. So if you're using the same
> > package variable in two different blocks, you have to use 'our'
On Aug 24, 9:37 am, [EMAIL PROTECTED] (Chas Owens) wrote:
> On 8/24/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
> snip> 'our', like 'my', is lexically scoped. Its effects are terminated
> > when the innermost enclosing block ends. So if you're using the same
> > package variable in two different bl
On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Paul Lalli wrote:
> > 'our', like 'my', is lexically scoped. Its effects are terminated
> > when the innermost enclosing block ends. So if you're using the same
> > package variable in two different blocks, you have to use 'our' in
> > e
On 8/24/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Tom Phoenix wrote:
> > Do you spell it initialised or initialized?
>
> Yes.
>
> british-english: initialise
> american-english: initialize
snip
Yes, but in Perl you have to choose one and stick to it. The original
code example was:
p
On 8/24/07, Marian Bednar <[EMAIL PROTECTED]> wrote:
snip
> print "$_->{filename} \n" if -f $_->{filename};
snip
> Script above write out nothing, but if last line is this
>
> print "$_->{filename} \n";
>
> It writes out names of files, directories, but I need only names of files.
> How can I get i
Hi Chas,
It is perfect. Thanks a lot.
Regards,
Rajeev Kilaru
On 8/24/07, Chas Owens <[EMAIL PROTECTED]> wrote:
>
> On 8/24/07, kilaru rajeev <[EMAIL PROTECTED]> wrote:
> > Hi Chas,
> >
> > I was not given the proper arguments to the *new* function. That is
> why, it
> > was failed to connect.
Tom Phoenix wrote:
Do you spell it initialised or initialized?
Yes.
british-english: initialise
american-english: initialize
--
Just my 0.0002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
"If you think Terra
On 8/23/07, Sundeep <[EMAIL PROTECTED]> wrote:
> $XYZ::db_initialised = 0;
>
> sub init_db() {
> DB::init() unless $XYZ::db_initialized;
> $XYZ::db_initialized = 1;
> }
Do you spell it initialised or initialized?
Cheers!
--Tom Phoenix
Stonehenge Perl Training
--
To unsubscribe, e-ma
On 8/24/07, Pat Rice <[EMAIL PROTECTED]> wrote:
> open (DATA, "$data_file") or die "can't open $data_file $!";
> my @array_of_data = ;
That reads the entire file into the array.
> while ($line = )
That goes back to try to read more, but you're already at end-of-file.
So it won't find anything.
Hi all,
I'm trying to get the follwoing to work:
what I am aiming to do is the following:
1. Read a file
2. Regex the df file and look for the line which contains "Used".
Problem:
- part 1 reads the file, confirmed, because I output this to the screen
- Part 2 Is where the problem is, as I connot
Paul Lalli wrote:
'our', like 'my', is lexically scoped. Its effects are terminated
when the innermost enclosing block ends. So if you're using the same
package variable in two different blocks, you have to use 'our' in
each of them:
'our' is not lexically scoped; it is package scoped. Once
On 8/24/07, kilaru rajeev <[EMAIL PROTECTED]> wrote:
> Hi Chas,
>
> I was not given the proper arguments to the *new* function. That is why, it
> was failed to connect. This time I have another trouble. As part of my code,
> I have used the below to statments to list the files in the directory.
>
Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:
my $content = do { local $/; <$file> };
That idiom uses an extra buffer, as big as the file.
my $content; { local $/; $content = }
Does it? In that case, why is it mentioned at
http://faq.perl.org/perlfaq5.html#How_can_I_read_in_an
On 8/24/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
> 'our', like 'my', is lexically scoped. Its effects are terminated
> when the innermost enclosing block ends. So if you're using the same
> package variable in two different blocks, you have to use 'our' in
> each of them:
snip
> Your syntax
On Friday 24 August 2007 08:57:26 Marian Bednar wrote:
> Hi all,
>
>
> I am a newbie in this forum and Perl too ;-)
>
> I am trying writing script transfering files using module
> Net::SFTP::Foreign.
>
> I need to retrieve from remote directory only names of files (not
> directories, links,etc.).
>
[EMAIL PROTECTED] wrote:
#1. I am not a SIR I am a Miss
#2 I was told I could post this...im my other post I had said I didn't
have any
experience with Perl, I didn't have any classes in college and my boss
gave me a side project to do. I'm trying to avoid paying 60 dollars an
hour for troublesh
On Aug 23, 7:13 pm, [EMAIL PROTECTED] wrote:
> On Aug 18, 7:58 pm, [EMAIL PROTECTED] (Paul Lalli) wrote:
> I've learned more about references and also about scoping of variables
> - now I'm doing "use strict" and it took a while to make it work here.
> A side question: why is it necessary to declar
Hi all,
I am a newbie in this forum and Perl too ;-)
I am trying writing script transfering files using module
Net::SFTP::Foreign.
I need to retrieve from remote directory only names of files (not
directories, links,etc.).
Something like this doesn't work:
--
use strict;
use wa
[EMAIL PROTECTED] ("Octavian Rasnita") writes:
> Hi,
>
> I want to make a program that connects to a remote Oracle database and
> then make it a .exe Windows executable.
>
> Is it possible to make it not depend on Oracle's client?
Install Oracle Instant Client, build DBD::Oracle and then try
whic
Hi Chas,
I was not given the proper arguments to the *new* function. That is why, it
was failed to connect. This time I have another trouble. As part of my code,
I have used the below to statments to list the files in the directory.
my @ls = $sftp->ls("$srcDir/");
print "\n->
On Aug 24, 2007, at 11:58 AM, Sundeep Gupta wrote:
The problem was that this module (XYZ) module uses another module,
which
again has the use statement to load XYZ. I don't know if the perl
loads the
module again and might be this caused to reset the value back to 0.
When I commented the use
Thanks Jeff,
It works fine now.
The problem was that this module (XYZ) module uses another module, which
again has the use statement to load XYZ. I don't know if the perl loads the
module again and might be this caused to reset the value back to 0.
When I commented the use statement of that modul
2007/8/24, Mihir Kamdar <[EMAIL PROTECTED]>:
>
> Here if I want the $cdr[13] to be written as a float(ex. 15.00), then how do
> I write it?
>
$cdr[13] = sprintf "%.2f", $cdr[6]*5.0 ;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl
2007/8/24, Justin The Cynical <[EMAIL PROTECTED]>:
> On Aug 23, 2:00 am, [EMAIL PROTECTED] (Lists User) wrote:
>
> *snip*
>
> > my %grouplist;
> > open HD,'groups.txt' or die $!;
> >
> > while() {
> > chomp;
> > my @tmp = split;
> > my $groupname = shift @tmp;
> > $grouplist{$groupn
Perl isn't a strong type language,it doesn't mind which data type it used.
> You can use printf() for printing a floating vlaue,like,
> $ perl -e 'printf("%.2f",3)'
> 3.00
that's right, but with respect to this particular code of mine, the $cdr[13]
is the "amount" field which should be a float.
2007/8/24, Sundeep <[EMAIL PROTECTED]>:
> I need to have a package level variable. For that I am using the
> following method:
>
> package XYZ;
>
> $XYZ::db_initialised = 0;
>
> sub init_db() {
> DB::init() unless $XYZ::db_initialized;
> $XYZ::db_initialized = 1;
> }
>
> or
>
> package XY
I need to have a package level variable. For that I am using the
following method:
package XYZ;
$XYZ::db_initialised = 0;
sub init_db() {
DB::init() unless $XYZ::db_initialized;
$XYZ::db_initialized = 1;
}
or
package XYZ;
my $db_initialised = 0;
sub init_db() {
DB::init() unle
On Aug 23, 3:42 am, [EMAIL PROTECTED] (Paul Lalli) wrote:
> On Aug 23, 2:00 am, [EMAIL PROTECTED] (Justin The Cynical) wrote:
*snip*
> > Can't use string ("prod01") as an ARRAY ref while "strict refs" in use
>
> perldoc -q "variable name"
Ah, OK, thanks. I've got a bit of reading to do. :-)
>
On Aug 23, 2:00 am, [EMAIL PROTECTED] (Lists User) wrote:
*snip*
> my %grouplist;
> open HD,'groups.txt' or die $!;
>
> while() {
> chomp;
> my @tmp = split;
> my $groupname = shift @tmp;
> $grouplist{$groupname} = [EMAIL PROTECTED];}
>
> close HD;
OK, thanks!
The Llama presents
2007/8/24, Mihir Kamdar <[EMAIL PROTECTED]>:
> But a few improvizations. $cdr[13] that I am trying to manipulate is a
> "amount" field and should be a floating point value...how can I print it as
> floating point in perl?
>
Perl isn't a strong type language,it doesn't mind which data type it used
Hi,
Thanks...i got my mistake...it worked after the below as Rob suggested:-
my @cdr=split (/,/, $line) ;
$cdr[13] = $cdr[6]*5.0 ;
$line = join(",",@cdr);
$hash{"@cdr[2,3,6,7]"}=$line;
But a few im
24 Aug 2007 00:21:09 -, Dan Otterburn <[EMAIL PROTECTED]>:
> On Tue, 21 Aug 2007 17:02:23 -0400, John Arbes wrote:
>
> > Does anyone have any recommendations on Perl Courses
>
> I believe Stonehenge are excellent (http://www.stonehenge.com/) - they
> certainly should be given their roster!
>
Y
2007/8/24, Mihir Kamdar <[EMAIL PROTECTED]>:
> $cdr[13] = $cdr[6]*5 ;
> $hash{"@cdr[2,3,6,7]"}=$line;
Hello,
I checked the codes,but I'm not sure what's the meanings of those 2 lines above.
I can't see the logic relation with the 2 l
Of course it is
Your %hash gets filled with a structure that looks like this:
{ KEY => VALUE }
{ "@cdr[2,3,6,7]"=> $line}
Then you take all the values and write them out to a file. Since you never
changed the $line variable you should get the same result in your out file
as
On 8/24/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
> 2007/8/24, Mihir Kamdar <[EMAIL PROTECTED]>:
>
> > $cdr[13] = $cdr[6]*5 ; ###Can I do something like this
>
> sure,why can't?
Hi,
Please look at my code below and comment. I am trying to manipulate 13th
field of my record. But I am not
Your idea should work pretty well assuming that you are 100% sure that the
thing in field 7 really is a number, you might get strange results if field
7 is empty or somehting else then a number.
As for how to handle the files that is really up to you and the environment
you work in... if your file
On Tue, 21 Aug 2007 17:02:23 -0400, John Arbes wrote:
> Does anyone have any recommendations on Perl Courses
I believe Stonehenge are excellent (http://www.stonehenge.com/) - they
certainly should be given their roster!
--
Dan Otterburn <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL P
Gunnar Hjalmarsson schreef:
> my $content = do { local $/; <$file> };
That idiom uses an extra buffer, as big as the file.
my $content; { local $/; $content = }
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai
Jay Savage schreef:
> Dr.Ruud:
>>> Christopher Spears:
#print $regexp;
>>
>> Make that
>> print qr/$regexp/;
>
> Not sure where your headed with this.
My headed? :)
It was an alternative for the commented "debug" line.
> First, OP wants to print the input back to the user.
And I pre
2007/8/24, Mihir Kamdar <[EMAIL PROTECTED]>:
> $cdr[13] = $cdr[6]*5 ; ###Can I do something like this
sure,why can't?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
76 matches
Mail list logo