2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
> Hi ,
>
> I want to redirect to a different url with the parameters in the post
> method.
>
Well,see 'perldoc CGI' and specially check for,
param,
redirect.
Good luck!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
Hi Group-
(Please excuse me if this post is a duplicate - free news servers
aren't reliable)
I'm trying to figure out how to recursively scan an HTML tree.
Through
trial and error I've arrived at the solution below except I'm stumped
on how
to recurse into the next level. I can't seem to find a
On Aug 25, 2007, at 4:54 AM, Yoyoyo Yoyoyoyo wrote:
I use a mac and I was wondering if there was a way to convert unix
newlines in a text file to dos newlines.
Yeah, with a Perl one-liner it would be
perl -pi -we 's/\n/\r\n/' file.txt
or
perl -pi.bak -we 's/\n/\r\n/' file.txt
if you w
On 8/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
snp
> I'm trying to figure out how to recursively scan an HTML tree.
snip
#!/usr/bin/perl
use strict;
use warnings;
use HTML::TreeBuilder;
my $tree = HTML::TreeBuilder->new();
$tree->parse_file("t.html");
recurse($tree);
sub recurse {
On Aug 24, 9:03 am, [EMAIL PROTECTED] (Paul Lalli) 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:
>
Yes
On 8/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
snip
> No, the version of DBI that I am using is very current so apparently
> the DBI book is current on that issue also. Using your code above
> (same as book) worked fine.
snip
Ah, I knew there was a reason beyond readability that I prefe
On Aug 25, 6:09 am, [EMAIL PROTECTED] (Chas Owens) wrote:
> Ah, I knew there was a reason beyond readability that I preferred
> fetchrow_hashref:
>
> from perldoc DBI
>"fetchrow_arrayref"
>Note that the same array reference is returned for each fetch,
>"fetchrow_hashre
Thanks, but quick question. If I do it from the command line it works fine.
But if I add:
`perl -pi -we 's/\n/\r\n/' ./student.csv`;
to my perl script it doesn't make the change to the file. Is there a reason
for this?
Robert
Xavier Noria <[EMAIL PROTECTED]> wrote: On Aug 25, 2007, at 4:5
On Aug 25, 2007, at 4:53 PM, Yoyoyo Yoyoyoyo wrote:
Thanks, but quick question. If I do it from the command line it
works fine. But if I add:
`perl -pi -we 's/\n/\r\n/' ./student.csv`;
to my perl script it doesn't make the change to the file. Is there
a reason for this?
Sure, the lite
Hello,
In many languages there is a function for convert int
for string. Ho I can do it in Perl ?
Best regards,
Rodrigo Faria
Flickr agora em português. Você clica, todo mundo vê.
http://www.flickr.com.br/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [E
2007/8/26, Rodrigo Tavares <[EMAIL PROTECTED]>:
> Hello,
>
> In many languages there is a function for convert int
> for string. Ho I can do it in Perl ?
>
Hello,
Perl isn't a strong type language like C,so you don't have the need to
convert the variable type distinctly.
for example,
my $x = 123
On 8/25/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
> 2007/8/26, Rodrigo Tavares <[EMAIL PROTECTED]>:
> > Hello,
> >
> > In many languages there is a function for convert int
> > for string. Ho I can do it in Perl ?
> >
>
> Hello,
>
> Perl isn't a strong type language like C,so you don't have the need
Hello Jeff,
See this simple script:
print "Enter with the fisrst number\n";
my $num = ;
How I can to convert variable $num, in string ?
Best regards,
Rodrigo Faria
--- Jeff Pang <[EMAIL PROTECTED]> escreveu:
> 2007/8/26, Rodrigo Tavares
> <[EMAIL PROTECTED]>:
> > Hello,
> >
> > In many la
2007/8/26, Rodrigo Tavares <[EMAIL PROTECTED]>:
> Hello Jeff,
>
> See this simple script:
>
> print "Enter with the fisrst number\n";
> my $num = ;
>
> How I can to convert variable $num, in string ?
>
This is really depend on what operation context the variable is in.
As I've said,when you use it
Hello,
I want to convert the int for string, then use the
function lenght, and return the size of string.
How It is possible ?
Best regards,
Rodrigo Faria
--- Jeff Pang <[EMAIL PROTECTED]> escreveu:
> 2007/8/26, Rodrigo Tavares
> <[EMAIL PROTECTED]>:
> > Hello Jeff,
> >
> > See this simple s
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references to two
subroutines. One will use File::Fin
Rodrigo Tavares wrote:
Hello,
I want to convert the int for string, then use the
function lenght, and return the size of string.
How It is possible ?
Perl automatically converts a number to and string (and back again) as needed.
To get the length of its string, use the length function:
my
On 8/25/07, Rodrigo Tavares <[EMAIL PROTECTED]> wrote:
> In many languages there is a function for convert int
> for string. Ho I can do it in Perl ?
It's so easy to put a number into a string, we don't have a function
for it. We simply interpolate:
my $age = 6 * 7; # or any other number
pri
On 8/25/07, Chris <[EMAIL PROTECTED]> wrote:
> if (my $start <= $timestamp <= my $stop){
Until Perl 6, you have to break down chain comparisons like this into
separate comparisons, usually joined with 'and':
if ($start <= $timestamp and $timestamp <= $stop) { ... }
But the real problem
Chris wrote:
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references to two
subroutines. One wil
Mr. Shawn H. Corey wrote:
Chris wrote:
I'm working on yet another exercise from Intermediate Perl. I've been
given a script that searches for files that fall between a two
timestamps. For the exercise, I am supposed to write the
gather_mtime_between subroutine that will return two references t
Hello,
I bought a book about Programming Perl, there is a
exercise :
1) Enter with a number and print asterisks (1..30)
ex: if you type six have go to screen:
**
See the below code :
if (($num1 >= 1 && $num1 <= 30)
{
for (my $i=1 ; $i < 30 ; $i++)
{
while ($num1 == $i)
Rodrigo Tavares schreef:
> print "Enter with the fisrst number\n";
> my $num = ;
>
> How I can to convert variable $num, in string ?
$num already contains a string. When you input 1 2 3 , it will
contain "123\n".
With chomp() you can remove the newline, but you can also use int(), see
`perldoc -
Shawn schreef:
> Chris:
>> I'm working on yet another exercise from Intermediate Perl. I've
>> been given a script that searches for files that fall between a two
>> timestamps. For the exercise, I am supposed to write the
>> gather_mtime_between subroutine that will return two references to
>>
On Sat, 2007-08-25 at 16:36 -0300, Rodrigo Tavares wrote:
> if (($num1 >= 1 && $num1 <= 30)
> {
> for (my $i=1 ; $i < 30 ; $i++)
> {
> while ($num1 == $i)
> {
> print "*";
> }
> }
> }
Think in terms of values: Use 6 instead of $num1 and thin
Rodrigo Tavares wrote:
1) Enter with a number and print asterisks (1..30)
ex: if you type six have go to screen:
**
if ( $num >= 1 and $num <= 30 ) {
print '*' x $num, "\n";
}
if (($num1 >= 1 && $num1 <= 30)
{
for (my $i=1 ; $i < 30 ; $i++)
{
while ($n
Jeff Pang wrote:
2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
I want to redirect to a different url with the parameters in the post
method.
Well,see 'perldoc CGI' and specially check for,
param,
redirect.
How do you combine a POST request and a 'Location:' header (which is
what CGI::red
Ok, if anyone is interested, here is my answer:
#!/usr/bin/perl -w
# Testing code for Exercise 6-1. Your task is to write the sub
# gather_mtime_between.
use strict;
use File::Find;
use Time::Local;
my ($start, $stop) = @_;
my @starting_directories = @_;
my @found_items;
sub gather_mtime_betw
Rodrigo Tavares wrote:
Hello,
Hello,
I bought a book about Programming Perl, there is a
exercise :
1) Enter with a number and print asterisks (1..30)
ex: if you type six have go to screen:
**
See the below code :
if (($num1 >= 1 && $num1 <= 30)
{
for (my $i=1 ; $i < 30 ; $i++)
On 08/25/2007 04:32 PM, Gunnar Hjalmarsson wrote:
Jeff Pang wrote:
2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
I want to redirect to a different url with the parameters in the post
method.
Well,see 'perldoc CGI' and specially check for,
param,
redirect.
How do you combine a POST reques
Chris schreef:
> #!/usr/bin/perl -w
Toss the -w, and insert a "use warnings;".
> my ($start, $stop) = @_;
> my @starting_directories = @_;
This doesn't do what I think that you think it does.
> my($sec, $min, $hour, $day, $mon, $yr, $dow) = localtime;
Is the start/top related to today?
What
Mumia W. wrote:
On 08/25/2007 04:32 PM, Gunnar Hjalmarsson wrote:
Jeff Pang wrote:
2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
I want to redirect to a different url with the parameters in the post
method.
Well,see 'perldoc CGI' and specially check for,
param,
redirect.
How do you comb
> ""Jeff" == "Jeff Pang" <[EMAIL PROTECTED]> writes:
"Jeff> Perl isn't a strong type language like C,so you don't have the need to
"Jeff> convert the variable type distinctly.
Perl is a very strongly typed language. The problem is that people keep
thinking "number" or "string" is a type in P
On 8/25/07, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> >>> 2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
> I want to redirect to a different url with the parameters in the post
> method.
> This is the last para of that section:
> "If the 307 status code is received in response to
yitzle wrote:
On 8/25/07, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
So I don't think that 307 is the proper status code for a redirect via a
POST request.
307 sounds right. The user agent (ie usually the internet browser)
will tell the user that there is a redirect, does the user want to
p
On 08/25/2007 07:39 PM, Gunnar Hjalmarsson wrote:
Mumia W. wrote:
On 08/25/2007 04:32 PM, Gunnar Hjalmarsson wrote:
Jeff Pang wrote:
2007/8/25, Praveena Vittal <[EMAIL PROTECTED]>:
I want to redirect to a different url with the parameters in the post
method.
Well,see 'perldoc CGI' and spec
36 matches
Mail list logo