How to run

2002-10-23 Thread Sent To
Hi

How can I run perl scrip on windows?
Is ther any software I need to install and what file extension should i use?
Thanks

regards
sentor
-- 
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to run

2002-10-23 Thread Beau E. Cox
Hi -

1) get ActiveState perl at http://www.activestate.com/Products/ActivePerl/
click the download button at the upper left, follow the
instructions, use the defaults - easy, fast, simple.

2) normally use the extension .pl for perl scripts.

3) to run your script, open a command prompt and type

perl myscript.pl [arguments...]

ActiveState also has a mailing list for win32/ActivePerl
users.

Welcome to the wonderful world of Perl!

Aloha => Beau.

-Original Message-
From: Sent To [mailto:sento@;mail.com]
Sent: Tuesday, October 22, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: How to run


Hi

How can I run perl scrip on windows?
Is ther any software I need to install and what file extension should i use?
Thanks

regards
sentor
--
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to run cgi script

2008-09-01 Thread Irfan J Sayed (isayed)
Hi,
 
I have installed IIS on my machine (to make my machine web server). Now
i need to execute / run cgi script on my machine.
cgi script is saved in c:\irfan.
 
now how should i run this cgi script in web browser. which webURL i
should give.
 
Regards
Irfan.
 


how to run perl class?

2005-08-24 Thread praba har
Dear All,

  I try to run a sampleclass example program
in perl. But I received error. How to avoid it?
The code is below:

Package Person;

sub new
 {
 my($type) = $_[0];
 my($self) = {};
 $self->{'name'} = $_[1];
 bless($self, $type);
 return($self);
 }

sub tellname
 {
 my($self)=$_[0];
 print "Person name is $self->{'name'}.\n";
 }

return(1);

Class calling program is below:
***
se lib $ENV{"HOME"}."/perl";
print $ENV{"HOME"}."\n";
use Person;
$obj = Person->new('Prabahar');
$wr->tellname();

error report is below:
**

Can't locate Person.pm in @INC (@INC contains:
/Users/enmail/perl
/System/Links/Libraries/perl5/5.8.7/i686-linux
/System/Links/Libraries/perl5/5.8.7
/System/Links/Libraries/perl5
/System/Links/Libraries/perl5/site_perl/5.8.7/i686-linux
/System/Links/Libraries/perl5/site_perl/5.8.7
/System/Links/Libraries/perl5/site_perl
/Programs/Perl/5.8.7/lib/perl5/5.8.7/i686-linux
/Programs/Perl/5.8.7/lib/perl5/5.8.7
/Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7/i686-linux
/Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7
/Programs/Perl/5.8.7/lib/perl5/site_perl .) at
class_calling.pl line 3.
BEGIN failed--compilation aborted at class_calling.pl
line 3.
How I need to run this script.

regards
Prabahar







Send a rakhi to your brother, buy gifts and win attractive prizes. Log on to 
http://in.promos.yahoo.com/rakhi/index.html

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
Someone kindly gave me an example of using DBI for MSAccess. It ran
initially. However, I have now, as part of my attempt to install bugzilla,
deinstalled perl 5.6 and perl 5.8 (which was incorrectly installed on top of
perl 5.6) and reinstalled perl 5.8+, DBI and DBD-Mysql and MySQL several
times and now the program below dies with the following error: "This
application has failed to start because Perl56.dll was not found."

The error message makes me wonder if I need to deinstall 5.8, install 5.6
and then install 5.8 on top of 5.6 without deinstalling 5.6 first.

Thanks,
Siegfried


#!c:/perl/bin/perl

use strict;
use DBI;

my $database = 'D:\Dodds\Nra\db1';
$database = 'D:\Dodds\Nra\Benefits\nra_tables2k.mdb';   # Access 2000 db
$database = 'c:/Program Files/Apache
Group/Apache2/cgi-bin/test_components02.mdb';   # Access 2000 db
$database =~ s|\\||g;   # create an escaped filename
$database =~ s|/||g;# create an escaped filename
my $DSN = "driver={Microsoft Access Driver (*.mdb)};dbq=$database";
my $dbh = DBI->connect("dbi:ODBC:$DSN","","") or 
die "$DBI::errstr\n";


#&show_tables;
#&count_rows("MoveIn", $dbh);
#&show_columns("tblCalls", $dbh);
#&show_columns("tblMemberCompanies", $dbh);
#&show_columns("tblContacts", $dbh);
#&show_columns("tblAdvertising", $dbh);
#&show_columns("tblConventions", $dbh);
&show_columns("BaseCaseTypes", $dbh);
&print_table("BaseCaseTypes", $dbh);

my $rc  = $dbh->disconnect;
exit;

sub print_table {
my ($table,$dbh) = @_;
my $sql = qq~Select * from [$table] where [Booth#] = 5131~;
my $sql = qq~Select * from [$table] where Date = #5/17/2000#~;
my $sql = qq~Select TOP 2 * from [$table]~;
#print $sql . "\n";
my $sth = $dbh->prepare($sql);
$sth->execute() or die "DBI Execute error: " . $sth->errstr . "\n";

# Print columns names
my ($columns, $col_types) = &_get_columns($table,$dbh);
my $x;
my $results;
foreach (@{$columns}) {
$results .= $_ . "|";
$x++;
}
print $results . "\n";

# Print values
my $x;
while (my @columns = $sth->fetchrow_array) {
my $y = 0;
foreach (@columns) {
$x .= $columns[$y] . "|";
$y++;
}
$x .= "\n";
}
print $x;
}

sub count_rows {
my ($table,$dbh) = @_;
my $sql = qq~Select * from [$table]~;
#print $sql . "\n";
my $sth = $dbh->prepare($sql);
$sth->execute() or die "DBI Execute error: " . $sth->errstr . "\n";
my $x;
while (my @columns = $sth->fetchrow_array) {
$x++;
}
print $table . " = " . $x . "\n";
}

sub show_columns {
my ($table,$dbh) = @_;
my ($columns, $col_types) = &_get_columns($table,$dbh);
my $x;
my $results;
foreach (@{$columns}) {
$results .= $_ . ":\t" . $col_types->[$x] . "\n";
$x++;
}
print $results;

} # show_columns


sub _get_columns {
my ($table,$dbh) = @_;
my $sql = qq~Select * from [$table]~;
my $sth = $dbh->prepare($sql);
$sth->execute() or die "DBI Execute error: " . $sth->errstr . "\n";
my $x;
my @columns;
my @col_types;
foreach (@{$sth->{NAME}}) {
  # if ($_ =~ /^s_/) {$x++; next;}; # skip system columns that begin
with "s_"
$columns[$x] = $sth->{NAME}->[$x];

# Get column type
my @type_info = $dbh->type_info($sth->{TYPE}->[$x]);
my $col_type;
my $y;
foreach (@type_info) {
$col_type .= $_->{TYPE_NAME};
$y++;
if ($y > 0) { $col_type .= ' ' };
}
chomp $col_type;
$col_types[$x] = $col_type;

$x++;
}
return ([EMAIL PROTECTED], [EMAIL PROTECTED]);
} # _get_columns

sub show_tables {
# Displays list of tables
my $display_sys_tables = 0;
my @tables = $dbh->tables;
my $x;
my $tn;
foreach $tn (@tables) {
if (($display_sys_tables) && ($tn =~ /^MSys/)) {
$x .= $tn . "\n";
} elsif (!($tn =~ /^MSys/)) {
$x .= $tn . "\n";
}
}
print $x;
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How to run script Perl automatically???

2003-03-25 Thread lielie meimei
Hello...Would u help me to solve thi prob:

How to run a perl script automatic when web server
start running ???

Because i want to run a perl script without run it
manually in konsole..

What should i do???


Thanks very-very for u help :)

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to run -- some notes

2002-10-23 Thread shawn_milochik

I have Active Perl installed on Windows 2000, and to run the script, I only
need to type "script.pl".  "perl script.pl" works also, but isn't
necessary.  On a Windows NT machine I have found that, when using the 'at'
command to schedule a script, I can't use "perl script.pl" or it fails --
"script.pl" works, though.

Shawn




   

  [EMAIL PROTECTED] 

   To:  [EMAIL PROTECTED], 
[EMAIL PROTECTED] 
  10/23/2002 05:38 cc: 

  AM   bcc:

          Please respond   Subject: RE: How to run 

  to beau  

   

   





Hi -

1) get ActiveState perl at http://www.activestate.com/Products/ActivePerl/
click the download button at the upper left, follow the
instructions, use the defaults - easy, fast, simple.

2) normally use the extension .pl for perl scripts.

3) to run your script, open a command prompt and type

perl myscript.pl [arguments...]

ActiveState also has a mailing list for win32/ActivePerl
users.

Welcome to the wonderful world of Perl!

Aloha => Beau.

-Original Message-
From: Sent To [mailto:sento@;mail.com]
Sent: Tuesday, October 22, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: How to run


Hi

How can I run perl scrip on windows?
Is ther any software I need to install and what file extension should i
use?
Thanks

regards
sentor
--
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








**
This e-mail and any files transmitted with it may contain 
confidential information and is intended solely for use by 
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not 
disclose its contents to others and delete it from your 
system.

**


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to run -- some notes

2002-10-23 Thread Beau E. Cox
Yea Shawn -

ActivePerl sets the windows file association to perl for
..pl files.

I don't know the "at" problem...

I stick to the perl script.pl format because I remember
having problems passing arguments to the script w/the
short form...never got around to finding out why.

Aloha => Beau.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:shawn_milochik@;godivachoc.com]
Sent: Wednesday, October 23, 2002 2:56 AM
To: [EMAIL PROTECTED]
Subject: RE: How to run -- some notes



I have Active Perl installed on Windows 2000, and to run the script, I only
need to type "script.pl".  "perl script.pl" works also, but isn't
necessary.  On a Windows NT machine I have found that, when using the 'at'
command to schedule a script, I can't use "perl script.pl" or it fails --
"script.pl" works, though.

Shawn





  [EMAIL PROTECTED]
   To:  [EMAIL PROTECTED],
[EMAIL PROTECTED]
  10/23/2002 05:38 cc:
  AM               bcc:
  Please respond   Subject: RE: How to run
  to beau






Hi -

1) get ActiveState perl at http://www.activestate.com/Products/ActivePerl/
click the download button at the upper left, follow the
instructions, use the defaults - easy, fast, simple.

2) normally use the extension .pl for perl scripts.

3) to run your script, open a command prompt and type

perl myscript.pl [arguments...]

ActiveState also has a mailing list for win32/ActivePerl
users.

Welcome to the wonderful world of Perl!

Aloha => Beau.

-Original Message-
From: Sent To [mailto:sento@;mail.com]
Sent: Tuesday, October 22, 2002 3:08 PM
To: [EMAIL PROTECTED]
Subject: How to run


Hi

How can I run perl scrip on windows?
Is ther any software I need to install and what file extension should i
use?
Thanks

regards
sentor
--
__
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








**
This e-mail and any files transmitted with it may contain
confidential information and is intended solely for use by
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not
disclose its contents to others and delete it from your
system.

**


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run -- some notes

2002-10-23 Thread Dave K
Hope this is helpful...
Setting file associations is done by ActivePerl but if you want to use
command line parameters:
go to
My Computer,
  View,
Options,
   File Types
 Edit the file type with the .pl extension,
Edit the 'Open' action
Include %1 %* so that the last portion of the line looks like
\perl.exe %1 %*
This will give you access to command line parameters

"Beau E. Cox" <[EMAIL PROTECTED]> wrote in message
news:HJENIAHJOBAICFNFJEAIKEMDCAAA.beau@;beaucox.com...
> Yea Shawn -
>
> ActivePerl sets the windows file association to perl for
> ..pl files.
>
> I don't know the "at" problem...
>
> I stick to the perl script.pl format because I remember
> having problems passing arguments to the script w/the
> short form...never got around to finding out why.
>
> Aloha => Beau.
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:shawn_milochik@;godivachoc.com]
> Sent: Wednesday, October 23, 2002 2:56 AM
> To: [EMAIL PROTECTED]
> Subject: RE: How to run -- some notes
>
>
>
> I have Active Perl installed on Windows 2000, and to run the script, I
only
> need to type "script.pl".  "perl script.pl" works also, but isn't
> necessary.  On a Windows NT machine I have found that, when using the 'at'
> command to schedule a script, I can't use "perl script.pl" or it fails --
> "script.pl" works, though.
>
> Shawn
>
>
>
>
>
>   [EMAIL PROTECTED]
>To:      [EMAIL PROTECTED],
> [EMAIL PROTECTED]
>   10/23/2002 05:38 cc:
>   AM   bcc:
>   Please respond   Subject: RE: How to run
>   to beau
>
>
>
>
>
>
> Hi -
>
> 1) get ActiveState perl at http://www.activestate.com/Products/ActivePerl/
> click the download button at the upper left, follow the
> instructions, use the defaults - easy, fast, simple.
>
> 2) normally use the extension .pl for perl scripts.
>
> 3) to run your script, open a command prompt and type
>
> perl myscript.pl [arguments...]
>
> ActiveState also has a mailing list for win32/ActivePerl
> users.
>
> Welcome to the wonderful world of Perl!
>
> Aloha => Beau.
>
> -Original Message-
> From: Sent To [mailto:sento@;mail.com]
> Sent: Tuesday, October 22, 2002 3:08 PM
> To: [EMAIL PROTECTED]
> Subject: How to run
>
>
> Hi
>
> How can I run perl scrip on windows?
> Is ther any software I need to install and what file extension should i
> use?
> Thanks
>
> regards
> sentor
> --
> __
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
> **
> This e-mail and any files transmitted with it may contain
> confidential information and is intended solely for use by
> the individual to whom it is addressed.  If you received
> this e-mail in error, please notify the sender, do not
> disclose its contents to others and delete it from your
> system.
>
> **
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to run -- some notes

2002-10-23 Thread Beau E. Cox
too cool - thanks dave!

-Original Message-
From: Dave K [mailto:dkirol@;erols.com]
Sent: Wednesday, October 23, 2002 3:38 AM
To: [EMAIL PROTECTED]
Subject: Re: How to run -- some notes


Hope this is helpful...
Setting file associations is done by ActivePerl but if you want to use
command line parameters:
go to
My Computer,
  View,
Options,
   File Types
 Edit the file type with the .pl extension,
Edit the 'Open' action
Include %1 %* so that the last portion of the line looks like
\perl.exe %1 %*
This will give you access to command line parameters

"Beau E. Cox" <[EMAIL PROTECTED]> wrote in message
news:HJENIAHJOBAICFNFJEAIKEMDCAAA.beau@;beaucox.com...
> Yea Shawn -
>
> ActivePerl sets the windows file association to perl for
> ..pl files.
>
> I don't know the "at" problem...
>
> I stick to the perl script.pl format because I remember
> having problems passing arguments to the script w/the
> short form...never got around to finding out why.
>
> Aloha => Beau.
>
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:shawn_milochik@;godivachoc.com]
> Sent: Wednesday, October 23, 2002 2:56 AM
> To: [EMAIL PROTECTED]
> Subject: RE: How to run -- some notes
>
>
>
> I have Active Perl installed on Windows 2000, and to run the script, I
only
> need to type "script.pl".  "perl script.pl" works also, but isn't
> necessary.  On a Windows NT machine I have found that, when using the 'at'
> command to schedule a script, I can't use "perl script.pl" or it fails --
> "script.pl" works, though.
>
> Shawn
>
>
>
>
>
>   [EMAIL PROTECTED]
>To:      [EMAIL PROTECTED],
> [EMAIL PROTECTED]
>   10/23/2002 05:38 cc:
>   AM   bcc:
>   Please respond   Subject: RE: How to run
>   to beau
>
>
>
>
>
>
> Hi -
>
> 1) get ActiveState perl at http://www.activestate.com/Products/ActivePerl/
> click the download button at the upper left, follow the
> instructions, use the defaults - easy, fast, simple.
>
> 2) normally use the extension .pl for perl scripts.
>
> 3) to run your script, open a command prompt and type
>
> perl myscript.pl [arguments...]
>
> ActiveState also has a mailing list for win32/ActivePerl
> users.
>
> Welcome to the wonderful world of Perl!
>
> Aloha => Beau.
>
> -Original Message-
> From: Sent To [mailto:sento@;mail.com]
> Sent: Tuesday, October 22, 2002 3:08 PM
> To: [EMAIL PROTECTED]
> Subject: How to run
>
>
> Hi
>
> How can I run perl scrip on windows?
> Is ther any software I need to install and what file extension should i
> use?
> Thanks
>
> regards
> sentor
> --
> __
> Sign-up for your own FREE Personalized E-mail at Mail.com
> http://www.mail.com/?sr=signup
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
> **
> This e-mail and any files transmitted with it may contain
> confidential information and is intended solely for use by
> the individual to whom it is addressed.  If you received
> this e-mail in error, please notify the sender, do not
> disclose its contents to others and delete it from your
> system.
>
> **
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run cgi script

2008-09-01 Thread Rob Dixon
Irfan J Sayed (isayed) wrote:
> Hi,
>  
> I have installed IIS on my machine (to make my machine web server). Now
> i need to execute / run cgi script on my machine.
> cgi script is saved in c:\irfan.
>  
> now how should i run this cgi script in web browser. which webURL i
> should give.

This is a question about Internet Information Services rather than Perl, and you
should read your IIS documentation thoroughly. You should be able to connect to
your own PC by using a URL like

  http://localhost/cgi.pl

but first you will need to set up the home page folder of your web site and
enable CGI, which is disabled by default.

HTH,

Rob

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: how to run perl class?

2005-08-24 Thread Muthukumar
On 8/24/05, praba har <[EMAIL PROTECTED]> wrote:
> Dear All,
> 
>  I try to run a sampleclass example program
> in perl. But I received error. How to avoid it?
> The code is below:
> 
> Package Person;
> 
> sub new
> {
> my($type) = $_[0];
> my($self) = {};
> $self->{'name'} = $_[1];
> bless($self, $type);
> return($self);
> }
> 
> sub tellname
> {
> my($self)=$_[0];
> print "Person name is $self->{'name'}.\n";
> }
> 
> return(1);
> 
> Class calling program is below:
> ***
> se lib $ENV{"HOME"}."/perl";
> print $ENV{"HOME"}."\n";
> use Person;
> $obj = Person->new('Prabahar');
> $wr->tellname();
> 
> error report is below:
> **
> 
> Can't locate Person.pm in @INC (@INC contains:
> /Users/enmail/perl
> /System/Links/Libraries/perl5/5.8.7/i686-linux
> /System/Links/Libraries/perl5/5.8.7
> /System/Links/Libraries/perl5
> /System/Links/Libraries/perl5/site_perl/5.8.7/i686-linux
> /System/Links/Libraries/perl5/site_perl/5.8.7
> /System/Links/Libraries/perl5/site_perl
> /Programs/Perl/5.8.7/lib/perl5/5.8.7/i686-linux
> /Programs/Perl/5.8.7/lib/perl5/5.8.7
> /Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7/i686-linux
> /Programs/Perl/5.8.7/lib/perl5/site_perl/5.8.7
> /Programs/Perl/5.8.7/lib/perl5/site_perl .) at
> class_calling.pl line 3.
> BEGIN failed--compilation aborted at class_calling.pl
> line 3.
> How I need to run this script.

You have to include Person.pm location in @INC location. As,

@INC=(@INC,.);

or

run perl with -I option also.

perl -I. 

hth.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to run perl class?

2005-08-24 Thread Xavier Noria


On Aug 24, 2005, at 9:39, praba har wrote:


Dear All,

  I try to run a sampleclass example program
in perl. But I received error. How to avoid it?
The code is below:

Package Person;


Perl is case-sensitive: "package".


Can't locate Person.pm in @INC (@INC contains:
/Users/enmail/perl


Does /Users/enmail/perl/Person.pm exist?

-- fxn

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Fwd: how to run perl class?

2005-08-24 Thread Tech tech417
-- Forwarded message --
From: Tech tech417 <[EMAIL PROTECTED]>
Date: Aug 24, 2005 3:09 PM
Subject: Re: how to run perl class?
To: Xavier Noria <[EMAIL PROTECTED]>


Hi,

Create Person.pm with following contents:

package Person;

sub new
{
my($type) = $_[0];
my($self) = {};
$self->{'name'} = $_[1];
bless($self, $type);
return($self);
}

sub tellname
{
my($self)=$_[0];
print "Person name is $self->{'name'}.\n";
}
1;

and calling script test.pl is:

use Person;
$obj = Person->new('Prabahar');
$obj->tellname();

Now run the test.pl script.

# perl test.pl
Person name is Prabahar.

Thanks.


On 8/24/05, Xavier Noria <[EMAIL PROTECTED]> wrote:
>
> On Aug 24, 2005, at 9:39, praba har wrote:
>
> > Dear All,
> >
> >   I try to run a sampleclass example program
> > in perl. But I received error. How to avoid it?
> > The code is below:
> >
> > Package Person;
>
> Perl is case-sensitive: "package".
>
> > Can't locate Person.pm in @INC (@INC contains:
> > /Users/enmail/perl
>
> Does /Users/enmail/perl/Person.pm exist?
>
> -- fxn
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




How to run a batch file

2006-01-09 Thread The Roopak Times
Hi All

how can i run a batch file by a perl script.
i'm also getting a compilation error in following program. i have output of
ping commnad in a text file and i want to replace the IP Address with the
hostname.

error is:-
Global symbol "%sites " requires explicit package name at network.pl line
25.


#!usr/bin/perl
use warnings;
use strict;

#OPEN THE THE FILE "Check.txt" AND REPLACE IP ADDRESS WITH SITE NAMES

our %sites=(
  '172.16.8.8', "hostname1",
  '172.16.1.8', "hostname2",
  '172.16.4.8', "hostname3",
  '172.16.16.8', "hostname4"
   );

my $i;

open CHECK, ">>'Check.txt'" or die $!;
 while ()
  {
  for  $i (keys %hash)
  {
$_ =~ (s/$i/$hash[$i]/g);
  print CHECK $_;
  }
}

--
Thankx & Regards

Roopak Kr Prajapat


Re: How to run DBI for MSAccess?

2004-12-02 Thread Jenda Krynicky
From:   "Siegfried Heintze" <[EMAIL PROTECTED]>
> Someone kindly gave me an example of using DBI for MSAccess. It ran
> initially. However, I have now, as part of my attempt to install
> bugzilla, deinstalled perl 5.6 and perl 5.8 (which was incorrectly
> installed on top of perl 5.6) and reinstalled perl 5.8+, DBI and
> DBD-Mysql and MySQL several times and now the program below dies with
> the following error: "This application has failed to start because
> Perl56.dll was not found."
> 
> The error message makes me wonder if I need to deinstall 5.8, install
> 5.6 and then install 5.8 on top of 5.6 without deinstalling 5.6 first.

First, you need DBD::ODBC, not DBD::mysql!

Second, this seems like you have some leftovers of Perl 5.6 on your 
computer. I think it will be best to uninstall Perl, delete the perl 
directory, search for and delete any perl.exe and then install Perl 
5.8. The error suggests that you are running the script with an old 
perl.exe.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
How should I respond to ppm below? Has it installed ODBC?
Thanks,
 Siegfried

C:\Perl\bin>ppm3.bat
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
ActiveState is a devision of Sophos.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> install GD
Error: no suitable installation target found for package GD.
ppm> install DBD::ODBC
Searching for 'DBD::ODBC' returned multiple results. Using 'search'
instead...
Searching in Active Repositories
  1. DBD-ODBC [1.11] ODBC Driver for DBI
  2. DBD-ODBC [1.06] ODBC Driver for DBI
ppm>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to run DBI for MSAccess?

2004-12-02 Thread Jenda Krynicky
From:   "Siegfried Heintze" <[EMAIL PROTECTED]>
> How should I respond to ppm below? Has it installed ODBC?
> Thanks,
>  Siegfried
> 
> C:\Perl\bin>ppm3.bat
> PPM - Programmer's Package Manager version 3.1.
> Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
> ActiveState is a devision of Sophos.
> 
> Entering interactive shell. Using Term::ReadLine::Stub as readline
> library.
> 
> Type 'help' to get started.
> 
> ppm> install GD
> Error: no suitable installation target found for package GD.
> ppm> install DBD::ODBC
> Searching for 'DBD::ODBC' returned multiple results. Using 'search'
> instead... Searching in Active Repositories
>   1. DBD-ODBC [1.11] ODBC Driver for DBI
>   2. DBD-ODBC [1.06] ODBC Driver for DBI
> ppm>

It's telling you that it found two versions of the module in 
different repositories and asking you which one to install. Type

install 1

to install first one, the onle with the higher version.

HTH, Jenda

= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to run DBI for MSAccess?

2004-12-02 Thread Siegfried Heintze
J,
I could have sworn I had a clean install last night. As per your advice, I
installed V5.8 AGAIN (this is the third or fourth time) and now ppm does not
give me that prompt when I install DBD-ODBC. Strange. It just installs and
the sample program works.

Now if I could only figure out how to install GD...

Thanks,
  Siegfried

-Original Message-
From: Jenda Krynicky [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 02, 2004 11:16 AM
To: [EMAIL PROTECTED]
Subject: RE: How to run DBI for MSAccess?

From:   "Siegfried Heintze" <[EMAIL PROTECTED]>
> How should I respond to ppm below? Has it installed ODBC?
> Thanks,
>  Siegfried
> 
> C:\Perl\bin>ppm3.bat
> PPM - Programmer's Package Manager version 3.1.
> Copyright (c) 2001 ActiveState Corp. All Rights Reserved.
> ActiveState is a devision of Sophos.
> 
> Entering interactive shell. Using Term::ReadLine::Stub as readline
> library.
> 
> Type 'help' to get started.
> 
> ppm> install GD
> Error: no suitable installation target found for package GD.
> ppm> install DBD::ODBC
> Searching for 'DBD::ODBC' returned multiple results. Using 'search'
> instead... Searching in Active Repositories
>   1. DBD-ODBC [1.11] ODBC Driver for DBI
>   2. DBD-ODBC [1.06] ODBC Driver for DBI
> ppm>

It's telling you that it found two versions of the module in 
different repositories and asking you which one to install. Type

install 1

to install first one, the onle with the higher version.

HTH, Jenda

= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: How to run script Perl automatically???

2003-03-26 Thread Todd W

"Lielie Meimei" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello...Would u help me to solve thi prob:
>
> How to run a perl script automatic when web server
> start running ???
>
> Because i want to run a perl script without run it
> manually in konsole..
>

This is not the easiest thing in the workd to do, but luckily perl makes
hard things possible. If you are using a mod_perl enabled apache, there is a
step-by-step guideline of several different scenarios for starting programs
from an apache process:

http://perl.apache.org/docs/1.0/guide/performance.html#Forking_and_Executing
_Subprocesses_from_mod_perl

Todd W.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to run a batch file

2006-01-09 Thread Tom Allison

The Roopak Times wrote:

Hi All

how can i run a batch file by a perl script.
i'm also getting a compilation error in following program. i have output of
ping commnad in a text file and i want to replace the IP Address with the
hostname.

error is:-
Global symbol "%sites " requires explicit package name at network.pl line
25.


#!usr/bin/perl
use warnings;
use strict;

#OPEN THE THE FILE "Check.txt" AND REPLACE IP ADDRESS WITH SITE NAMES

our %sites=(
  '172.16.8.8', "hostname1",
  '172.16.1.8', "hostname2",
  '172.16.4.8', "hostname3",
  '172.16.16.8', "hostname4"
   );

my $i;

open CHECK, ">>'Check.txt'" or die $!;
 while ()
  {
  for  $i (keys %hash)
  {
$_ =~ (s/$i/$hash[$i]/g);
  print CHECK $_;
  }
}

--
Thankx & Regards

Roopak Kr Prajapat


Those aren't the errors I'm getting from your code.
Check your work again
You have several variable errors in addition to the very first line is also in 
error.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to run a batch file

2006-01-09 Thread swayam panda

HI,

 for  $i (keys %hash) where is %hash ? or it's %sites

Swayam

- Original Message - 
From: "The Roopak Times" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, January 10, 2006 12:54 AM
Subject: How to run a batch file


Hi All

how can i run a batch file by a perl script.
i'm also getting a compilation error in following program. i have output of
ping commnad in a text file and i want to replace the IP Address with the
hostname.

error is:-
Global symbol "%sites " requires explicit package name at network.pl line
25.


#!usr/bin/perl
use warnings;
use strict;

#OPEN THE THE FILE "Check.txt" AND REPLACE IP ADDRESS WITH SITE NAMES

our %sites=(
 '172.16.8.8', "hostname1",
 '172.16.1.8', "hostname2",
 '172.16.4.8', "hostname3",
 '172.16.16.8', "hostname4"
  );

my $i;

open CHECK, ">>'Check.txt'" or die $!;
while ()
 {
 for  $i (keys %hash)
 {
$_ =~ (s/$i/$hash[$i]/g);
 print CHECK $_;
 }
}

--
Thankx & Regards

Roopak Kr Prajapat


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




How to run FTP from a Perl Script

2001-08-14 Thread Russell Boyd

I have been looking at modules. But have not seen how to do an FTP session from a perl 
script that I can pass the appropriate info to.


Any Suggestions?


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: How to run FTP from a Perl Script

2001-08-14 Thread Rogers, Gary (AP- Server Adminstrator)

Net::FTP has a very nice interface to FTP. What in particular are you
looking to pass?

-Original Message-
From: Russell Boyd [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 14, 2001 2:43 PM
To: <
Subject: How to run FTP from a Perl Script


I have been looking at modules. But have not seen how to do an FTP session
from a perl script that I can pass the appropriate info to.


Any Suggestions?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




how to run perl file from a html page

2006-02-03 Thread a b
Hello all,

i am new and want to get the params from html page and execute perl script
at local machine
please help me in this matter.

thanks and regards,

abhishek


how to run a script at remote location (windows-->linux)

2007-12-26 Thread nandakishore saboo
Hi,

I would like to run perl script on linux machine from windows perl script.
Can any body help me out on this regard, is there any module which takes
care of this?

Thanks,
snanda.


Re: how to run perl file from a html page

2006-02-03 Thread Jeff Pang
I think this is a typical CGI-developing requirement.As someone in the list has 
said,

You could have a glance at chapter 12 of Beginning Perl for instance:
http://learn.perl.org/library/beginning_perl/3145_Chap12.pdf

Hope that be useful to you.

-Original Message-
>From: a b <[EMAIL PROTECTED]>
>Sent: Feb 3, 2006 5:31 AM
>To: beginners@perl.org
>Subject: how to run perl file from a html page
>
>Hello all,
>
>i am new and want to get the params from html page and execute perl script
>at local machine
>please help me in this matter.
>
>thanks and regards,
>
>abhishek


--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: how to run perl file from a html page

2006-02-03 Thread Xavier Noria

On Feb 3, 2006, at 11:31, a b wrote:


Hello all,

i am new and want to get the params from html page and execute perl  
script

at local machine
please help me in this matter.


How are you getting the HTML page in the local machine?


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to run perl file from a html page

2006-02-03 Thread a b
Hy ,

my scenario is have a html page in your c:\statichtmlpage.html
in the section of form i've written like
< form method=post action=perfile.pl>

<>

and a perl file that can retrieve params from statichtmlpage.html file and
execute some thing at local machine

i don't want to install any web server :-)

Expecting your valuable suggestions and some sample.

Thanks
Abhishek
On 2/3/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
> I think this is a typical CGI-developing requirement.As someone in the
> list has said,
>
> You could have a glance at chapter 12 of Beginning Perl for instance:
> http://learn.perl.org/library/beginning_perl/3145_Chap12.pdf
>
> Hope that be useful to you.
>
> -Original Message-
> >From: a b <[EMAIL PROTECTED]>
> >Sent: Feb 3, 2006 5:31 AM
> >To: beginners@perl.org
> >Subject: how to run perl file from a html page
> >
> >Hello all,
> >
> >i am new and want to get the params from html page and execute perl
> script
> >at local machine
> >please help me in this matter.
> >
> >thanks and regards,
> >
> >abhishek
>
>
> --
> Jeff Pang
> NetEase AntiSpam Team
> http://corp.netease.com
>


Re: how to run perl file from a html page

2006-02-03 Thread Xavier Noria


On Feb 3, 2006, at 14:28, a b wrote:


Hy ,

my scenario is have a html page in your c:\statichtmlpage.html
in the section of form i've written like
< form method=post action=perfile.pl>

<>

and a perl file that can retrieve params from statichtmlpage.html  
file and

execute some thing at local machine

i don't want to install any web server :-)


Just to double-check, do you realise that from a static HTML file on  
the disk you can only read the params as written in the source, and  
there's no interaction with anybody with any web browser? No dynamic  
content to read?


If you do, then the answer is to look at some HTML parser like  
HTML::Parser or HTML::TreeBuilder and extract whatever you need.  
Otherwise please reply sketching the flow of execution you have in mind.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to run perl file from a html page

2006-02-03 Thread JupiterHost.Net

a b wrote:

Hy ,


Hello,


my scenario is have a html page in your c:\statichtmlpage.html
in the section of form i've written like
< form method=post action=perfile.pl>

<>

and a perl file that can retrieve params from statichtmlpage.html file and
execute some thing at local machine

i don't want to install any web server :-)


So you want a plain text file to do an HTTP session with a local script?

*something* has to send the form's params to the script, i not a web 
server then I suppose you could write javascript that will get executed 
when they click submit that will take the form's values and run a system 
commend to your script with those params, but its going to be very 
difficult to server a dynamic web page with a web server to do it :)


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: how to run perl file from a html page

2006-02-06 Thread a b
Hy all,

I think i got the solution i am using perlscript @ client side in that
webpage and i am able to got the params from user
and able to execute some functions (with out any web server)

Thanks for your help.
a b

On 2/3/06, JupiterHost.Net <[EMAIL PROTECTED]> wrote:
>
> a b wrote:
> > Hy ,
>
> Hello,
>
> > my scenario is have a html page in your c:\statichtmlpage.html
> > in the section of form i've written like
> > < form method=post action=perfile.pl>
> > 
> > <>
> >
> > and a perl file that can retrieve params from statichtmlpage.html file
> and
> > execute some thing at local machine
> >
> > i don't want to install any web server :-)
>
> So you want a plain text file to do an HTTP session with a local script?
>
> *something* has to send the form's params to the script, i not a web
> server then I suppose you could write javascript that will get executed
> when they click submit that will take the form's values and run a system
> commend to your script with those params, but its going to be very
> difficult to server a dynamic web page with a web server to do it :)
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>  
>
>
>


How to run a perl script in background on Windows?

2011-08-03 Thread Jose Marquez
Hi there
 
Sure I am the newbiest of all Perl newbies in this group 
 
Just have been reading some of the posts you all have sent since I subscribe to 
this list 
 
What I'm trying to learn these days is how I run a Perl script in background on 
Windows. Can anybody give a hint on it?
 
Appreciate very much all the help you guys can provide me
 
Cheers
 
JM

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: how to run a script at remote location (windows-->linux)

2007-12-26 Thread Tom Phoenix
On Dec 26, 2007 3:08 AM, nandakishore saboo <[EMAIL PROTECTED]> wrote:

> I would like to run perl script on linux machine from windows perl script.

The most common way that people do that is when the Linux box is
running a webserver (such as Apache) which in turn runs a CGI program
written in Perl. Even if that isn't exactly what you're talking about,
could that be a way to do what you're looking for?

http://learn.perl.org/faq/beginners-cgi.html

It's certainly easier to leverage an existing service (in this case,
the http service) than to roll your own from scratch.

Good luck with it!

--Tom Phoenix
Stonehenge Perl Training

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: how to run a script at remote location (windows-->linux)

2007-12-26 Thread Chas. Owens
On Dec 26, 2007 11:21 AM, Tom Phoenix <[EMAIL PROTECTED]> wrote:
> On Dec 26, 2007 3:08 AM, nandakishore saboo <[EMAIL PROTECTED]> wrote:
>
> > I would like to run perl script on linux machine from windows perl script.
>
> The most common way that people do that is when the Linux box is
> running a webserver (such as Apache) which in turn runs a CGI program
> written in Perl. Even if that isn't exactly what you're talking about,
> could that be a way to do what you're looking for?
snip

That's funny, I would have said the most common way to run a script
remotely would be either Net::Telnet or Net::SSH (with a preference
for Net::SSH).  With CGI you need to use some form of authentication
(either roll your own or find a module) or anyone can run your script
remotely.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: How to run a perl script in background on Windows?

2011-08-03 Thread Brian F. Yulga

Jose Marquez wrote:

Hi there
  
Sure I am the newbiest of all Perl newbies in this group 
  
Just have been reading some of the posts you all have sent since I subscribe to this list 
  
What I'm trying to learn these days is how I run a Perl script in background on Windows. Can anybody give a hint on it?
   

Hi Jose,

As far as I know, the Windows cmd.exe environment doesn't let you 
background a process the same way a unix shell does with '&'.  However, 
I have used "start" to achieve a similar effect when launching a script:


C:\>  start /b perl script.pl

Type "start /?" at a cmd prompt to read about the "/B" switch.  With 
this switch, you'll still have the cmd.exe window open, but the prompt 
will return immediately.


Also, I use this with Strawberry Perl; I don't know if ActiveState has 
other tricks you can use.


Brian

  
Appreciate very much all the help you guys can provide me
  
Cheers
  
JM


   


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: How to run a perl script in background on Windows?

2011-08-03 Thread timothy adigun
Hi Jose,
 If you are using ActiveState you could use wperl.exe from your CLI, instead
of perl.exe.
 Regards

On Wed, Aug 3, 2011 at 10:00 PM, Brian F. Yulga wrote:

> Jose Marquez wrote:
>
>> Hi there
>>  Sure I am the newbiest of all Perl newbies in this group 
>>  Just have been reading some of the posts you all have sent since I
>> subscribe to this list   What I'm trying to learn these days is how I run a
>> Perl script in background on Windows. Can anybody give a hint on it?
>>
>>
> Hi Jose,
>
> As far as I know, the Windows cmd.exe environment doesn't let you
> background a process the same way a unix shell does with '&'.  However, I
> have used "start" to achieve a similar effect when launching a script:
>
> C:\>  start /b perl script.pl
>
> Type "start /?" at a cmd prompt to read about the "/B" switch.  With this
> switch, you'll still have the cmd.exe window open, but the prompt will
> return immediately.
>
> Also, I use this with Strawberry Perl; I don't know if ActiveState has
> other tricks you can use.
>
> Brian
>
>
>   Appreciate very much all the help you guys can provide me
>>  Cheers
>>  JM
>>
>>
>>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>


Re: How to run a perl script in background on Windows?

2011-08-03 Thread Sheppy R
If you are trying to run this at Startup you can set up the AutoExnt service
to run a .bat that launches the .pl file.

@Timothy - Sorry for the reply.

On Wed, Aug 3, 2011 at 6:43 PM, timothy adigun <2teezp...@gmail.com> wrote:

> Hi Jose,
>  If you are using ActiveState you could use wperl.exe from your CLI,
> instead
> of perl.exe.
>  Regards
>
> On Wed, Aug 3, 2011 at 10:00 PM, Brian F. Yulga  >wrote:
>
> > Jose Marquez wrote:
> >
> >> Hi there
> >>  Sure I am the newbiest of all Perl newbies in this group 
> >>  Just have been reading some of the posts you all have sent since I
> >> subscribe to this list   What I'm trying to learn these days is how I
> run a
> >> Perl script in background on Windows. Can anybody give a hint on it?
> >>
> >>
> > Hi Jose,
> >
> > As far as I know, the Windows cmd.exe environment doesn't let you
> > background a process the same way a unix shell does with '&'.  However, I
> > have used "start" to achieve a similar effect when launching a script:
> >
> > C:\>  start /b perl script.pl
> >
> > Type "start /?" at a cmd prompt to read about the "/B" switch.  With this
> > switch, you'll still have the cmd.exe window open, but the prompt will
> > return immediately.
> >
> > Also, I use this with Strawberry Perl; I don't know if ActiveState has
> > other tricks you can use.
> >
> > Brian
> >
> >
> >   Appreciate very much all the help you guys can provide me
> >>  Cheers
> >>  JM
> >>
> >>
> >>
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > For additional commands, e-mail: beginners-h...@perl.org
> > http://learn.perl.org/
> >
> >
> >
>


Re: How to run a perl script in background on Windows?

2011-08-03 Thread Shawn H Corey

On 11-08-03 12:48 PM, Jose Marquez wrote:

What I'm trying to learn these days is how I run a Perl script in background on 
Windows. Can anybody give a hint on it?


From the GUI:  open a new Command Prompt, start the program, minimize 
the window until its done.


To do it from a Perl script, you'll need Win32::Process 
http://metacpan.org/module/Win32::Process



--
Just my 0.0002 million dollars worth,
  Shawn

Confusion is the first step of understanding.

Programming is as much about organization and communication
as it is about coding.

The secret to great software:  Fail early & often.

Eliminate software piracy:  use only FLOSS.

"Make something worthwhile."  -- Dear Hunter

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: How to run a perl script in background on Windows?

2011-08-03 Thread Rob Dixon

On 03/08/2011 22:00, Brian F. Yulga wrote:

Jose Marquez wrote:

Hi there
Sure I am the newbiest of all Perl newbies in this group 
Just have been reading some of the posts you all have sent since I
subscribe to this list What I'm trying to learn these days is how I
run a Perl script in background on Windows. Can anybody give a hint on
it?


As far as I know, the Windows cmd.exe environment doesn't let you
background a process the same way a unix shell does with '&'. However, I
have used "start" to achieve a similar effect when launching a script:

C:\> start /b perl script.pl

Type "start /?" at a cmd prompt to read about the "/B" switch. With this
switch, you'll still have the cmd.exe window open, but the prompt will
return immediately.

Also, I use this with Strawberry Perl; I don't know if ActiveState has
other tricks you can use.


It depends what you expect of a background program.

At a cmd prompt,

  start perl script.pl

will start the program executing in a new window of its own, and all IO
to stdout and from stdin is done through that window. Another cmd prompt
will appear straight away in the original window unless you use

  start /wait perl script.pl

Alternatively, as Brian says

  start /b perl script.pl

starts the program without opening a new window. Anything it sends to
stdout will appear in your current current window, but there is no way
to type anything to stdin.

Finally, if by 'background' you mean to run the program at low priority,
then

  start /low perl script.pl

is what you need.

Clearly these command qualifiers can be combined as necessary.

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: How to run a perl script in background on Windows?

2011-08-05 Thread Christian Walde

On Wed, 03 Aug 2011 18:48:53 +0200, Jose Marquez  wrote:


What I'm trying to learn these days is how I run a Perl script in background on 
Windows. Can anybody give a hint on it?


If you mean "running it without a console window", then Win32::Detached is what 
you want to use.

--
With regards,
Christian Walde

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




How to run a shell command but not waiting for the result ?

2003-07-14 Thread LI NGOK LAM
I've tried to use exec, system, and ``. And also with and without $| = 1;
but seems unable to do what I want.

What I want to do is suppose like this :

print "Start";
exec "notepad";
print "End";

but I found my results are :

If I can see "End", the notepad won't come,
If I can run the notepad, I can't see the End
until I close the notepad.

So what can I do to make it possible to run the notepad, 
but then just leave it alone and go on with the rest of the
code ?

TIA

How to run a Perl code with arguments from EnginSite Perl editor?

2009-10-18 Thread LI, Tongmu
Hi all,

I am not a perl programmer but I have to deal with some Perl codes
recently. So my questions may sounds naive but they are sort of
difficult to me.
I am trying to run a perl code with 2 arguments according to the
instruction. I installed Active Perl and EnginSite Perl editor. But I
do not know where to specify the arguments.
Can some one help here?
Thanks very much.

Tongmu


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




RE: How to run a shell command but not waiting for the result ?

2003-07-14 Thread Tim Johnson

This will only work on Win32 systems, and it's kind of cheating, but...

system("start notepad");

The start command in Windows executes the command more or less as if it was
typed in at the Run... dialog.  Start will exit immediately after launching
the program.

-Original Message-
From: LI NGOK LAM [mailto:[EMAIL PROTECTED]
Sent: Monday, July 14, 2003 9:06 AM
To: [EMAIL PROTECTED]
Subject: How to run a shell command but not waiting for the result ?


I've tried to use exec, system, and ``. And also with and without $| = 1;
but seems unable to do what I want.

What I want to do is suppose like this :

print "Start";
exec "notepad";
print "End";

but I found my results are :

If I can see "End", the notepad won't come,
If I can run the notepad, I can't see the End
until I close the notepad.

So what can I do to make it possible to run the notepad, 
but then just leave it alone and go on with the rest of the
code ?

TIA

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to run a shell command but not waiting for the result ?

2003-07-14 Thread Beau E. Cox
- Original Message - 
From: "LI NGOK LAM" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 14, 2003 6:05 AM
Subject: How to run a shell command but not waiting for the result ?


I've tried to use exec, system, and ``. And also with and without $| = 1;
but seems unable to do what I want.

What I want to do is suppose like this :

print "Start";
exec "notepad";
print "End";

but I found my results are :

If I can see "End", the notepad won't come,
If I can run the notepad, I can't see the End
until I close the notepad.

So what can I do to make it possible to run the notepad, 
but then just leave it alone and go on with the rest of the
code ?

TIA

Hi -

If you have Perl 5.8, try threads:

use strict;
use warnings;
use threads;

my $thr = threads->new(\¬epad);
$thr->detach;

my $wait = 10;
while ($wait--) {
print "still alive $wait\n";
sleep 1;
}
print "ending\n";

sub notepad
{
system 'notepad';
}

see: perldoc perlthtut
(or as an html file under your html/lib/Pod
directory in your perl install tree.)

You first try won't work:

exec => NEVER returns (overlays you with
  notepad);
system => puts you into a wait till notepad finishes.

Aloha => Beau;
== please visit ==
<http://beaucox.com> => main site
<http://howtos.beaucox.com> => howtos
<http://PPM.beaucox.com> => perl PPMs
<http://CPAN.beaucox.com> => CPAN
== thank you ==



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to run a shell command but not waiting for the result ?

2003-07-14 Thread Jenda Krynicky
From: "LI NGOK LAM" <[EMAIL PROTECTED]>
> I've tried to use exec, system, and ``. And also with and without $| =
> 1; but seems unable to do what I want.

If everything else fails, try to read the manual :-)

perldoc -f exec
  exec LIST
  exec PROGRAM LIST
The "exec" function executes a system command *and never
returns*-- use "system" instead of "exec" if you want it to
return. It fails and returns false only if the command does not
exist *and* it is executed directly instead of via your system's
command shell (see below).
...

So exec() is definitely not what you are after.

You want
system( 1, "notepad");

perldoc perlport
system(1, @args)
spawns an external process and immediately returns its process
designator, without waiting for it to terminate.  Return value may
be used subsequently in C or C.  Failure to spawn() 
a subprocess is indicated by setting $? to "255 << 8".  C<$?> is set
in a way compatible with Unix (i.e. the exitstatus of the subprocess
is obtained by "$? >> 8", as described in the documentation).  

Actually this is something that should be documented better. It may 
seem that the system( 1, ...) only works on Win32 which is not true.

Anyway ... another option would be to use Win32::Process module.

HTH, Jenda

= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to run a shell command but not waiting for the result ?

2003-07-14 Thread Paul Johnson
On Mon, Jul 14, 2003 at 06:31:31PM +0200, Jenda Krynicky wrote:

> You want
>   system( 1, "notepad");

> Actually this is something that should be documented better.

I don't think anyone really wants to document it because it is such an
ugly hack :-(

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to run a shell command but not waiting for the result ?

2003-07-14 Thread Jenda Krynicky
From: Paul Johnson <[EMAIL PROTECTED]>
> On Mon, Jul 14, 2003 at 06:31:31PM +0200, Jenda Krynicky wrote:
> 
> > You want
> > system( 1, "notepad");
> 
> > Actually this is something that should be documented better.
> 
> I don't think anyone really wants to document it because it is such an
> ugly hack :-(

Yeah it's pretty ugly. I think they should either create a new 
builtin function for this or add a hashref parameter that would 
contain options. I'm sure people could come up with all kinds of 
handy options.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread Jason-Yahoo

I can run perl script in the DOS batch file e.g.


@echo Next line will run Perl Script
perl perl_sample1.pl



But, how can I run DOS batch files or commands and
executable file in the Perl script.  Please give me example.

__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




how to run Perl code in my own pc computer but not on server?

2001-08-08 Thread Kehai Li

how to run Perl code in my own pc computer but not on server?




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread A. Rivera

system("batchfile.bat");

- Original Message - 
From: "Jason-Yahoo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 09, 2001 4:09 PM
Subject: How to run DOS batch files or DOS commands in the Perl script


> I can run perl script in the DOS batch file e.g.
> 
> 
> @echo Next line will run Perl Script
> perl perl_sample1.pl
> 
> 
> 
> But, how can I run DOS batch files or commands and
> executable file in the Perl script.  Please give me example.
> 
> __
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread Jason-Yahoo

Thank you very much.  I tested successfully.  One more
question that how can I transfer the variables of in
Perl Script to DOS batch or vice versa (e.g.
"$name1_perl=..." in Perl; "set name1_dos=..." in DOS
Batch)

--- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> system("batchfile.bat");
> 
> - Original Message - 
> From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, November 09, 2001 4:09 PM
> Subject: How to run DOS batch files or DOS commands
> in the Perl script
> 
> 
> > I can run perl script in the DOS batch file e.g.
> > 
> > 
> > @echo Next line will run Perl Script
> > perl perl_sample1.pl
> > 
> > 
> > 
> > But, how can I run DOS batch files or commands and
> > executable file in the Perl script.  Please give
> me example.
> > 
> > __
> > Do You Yahoo!?
> > Find a job, post your resume.
> > http://careers.yahoo.com
> > 
> > -- 
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread A. Rivera

I'm not too sure of what you're asking for.  Can you give me a better
example?  Maybe someone else knows what you want.

- Original Message -
From: "Jason-Yahoo" <[EMAIL PROTECTED]>
To: "A. Rivera" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, November 09, 2001 4:37 PM
Subject: Re: How to run DOS batch files or DOS commands in the Perl script


> Thank you very much.  I tested successfully.  One more
> question that how can I transfer the variables of in
> Perl Script to DOS batch or vice versa (e.g.
> "$name1_perl=..." in Perl; "set name1_dos=..." in DOS
> Batch)
>
> --- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> > system("batchfile.bat");
> >
> > - Original Message -----
> > From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, November 09, 2001 4:09 PM
> > Subject: How to run DOS batch files or DOS commands
> > in the Perl script
> >
> >
> > > I can run perl script in the DOS batch file e.g.
> > >
> > > 
> > > @echo Next line will run Perl Script
> > > perl perl_sample1.pl
> > > 
> > > 
> > >
> > > But, how can I run DOS batch files or commands and
> > > executable file in the Perl script.  Please give
> > me example.
> > >
> > > __
> > > Do You Yahoo!?
> > > Find a job, post your resume.
> > > http://careers.yahoo.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> >
>
>
> __
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread Jason-Yahoo

Regular, I set variable contain in DOS batch file by:
set name1_dos=TomSmith

If I have a variable in Per script as:
$name1_perl=MaryGibson

How can I get the contain of $name1 to my DOS
environment or vice versa. That means how to transfer
MaryGibson to overwrite TomSmith, contain of
name1_dos, or vice versa?  Thank you for your help.

--- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> I'm not too sure of what you're asking for.  Can you
> give me a better
> example?  Maybe someone else knows what you want.
> 
> - Original Message -
> From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> To: "A. Rivera" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Friday, November 09, 2001 4:37 PM
> Subject: Re: How to run DOS batch files or DOS
> commands in the Perl script
> 
> 
> > Thank you very much.  I tested successfully.  One
> more
> > question that how can I transfer the variables of
> in
> > Perl Script to DOS batch or vice versa (e.g.
> > "$name1_perl=..." in Perl; "set name1_dos=..." in
> DOS
> > Batch)
> >
> > --- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> > > system("batchfile.bat");
> > >
> > > - Original Message -
> > > From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, November 09, 2001 4:09 PM
> > > Subject: How to run DOS batch files or DOS
> commands
> > > in the Perl script
> > >
> > >
> > > > I can run perl script in the DOS batch file
> e.g.
> > > >
> > > > 
> > > > @echo Next line will run Perl Script
> > > > perl perl_sample1.pl
> > > > 
> > > > 
> > > >
> > > > But, how can I run DOS batch files or commands
> and
> > > > executable file in the Perl script.  Please
> give
> > > me example.
> > > >
> > > >
> __
> > > > Do You Yahoo!?
> > > > Find a job, post your resume.
> > > > http://careers.yahoo.com
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
> > __
> > Do You Yahoo!?
> > Find a job, post your resume.
> > http://careers.yahoo.com
> >
> 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread Alfred Wheeler

I'm not sure this answers your question... However -

#!perl
open IT, ">mybat.bat";
print IT "\@echo off\n";
print IT "echo Hello World!\n";
close IT;
system ( "mybat.bat" );

- Original Message - 
From: "Jason-Yahoo" <[EMAIL PROTECTED]>
To: "A. Rivera" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, November 09, 2001 4:37 PM
Subject: Re: How to run DOS batch files or DOS commands in the Perl script


> Thank you very much.  I tested successfully.  One more
> question that how can I transfer the variables of in
> Perl Script to DOS batch or vice versa (e.g.
> "$name1_perl=..." in Perl; "set name1_dos=..." in DOS
> Batch)
> 
> --- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> > system("batchfile.bat");
> > 
> > - Original Message - 
> > From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, November 09, 2001 4:09 PM
> > Subject: How to run DOS batch files or DOS commands
> > in the Perl script
> > 
> > 
> > > I can run perl script in the DOS batch file e.g.
> > > 
> > > 
> > > @echo Next line will run Perl Script
> > > perl perl_sample1.pl
> > > 
> > > 
> > > 
> > > But, how can I run DOS batch files or commands and
> > > executable file in the Perl script.  Please give
> > me example.
> > > 
> > > __
> > > Do You Yahoo!?
> > > Find a job, post your resume.
> > > http://careers.yahoo.com
> > > 
> > > -- 
> > > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > > 
> > > 
> > 
> > 
> > -- 
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How to run DOS batch files or DOS commands in the Perl script

2001-11-09 Thread Jason Ya hoo

Hi Alfred,
Base on your answer, I added my idea and changed the
script as:

$name1_perl="MaryGibson";

open IT, ">t3.bat";
print IT "\@echo off\n";
print IT "set name1_dos=$name1_perl\n";
print IT "\@echo name1_dos=%name1_dos%\n";
close IT;
system ( "t3.bat" );

The contain of $name1_per1 ,MaryGibson, is transfer to
DOS shell as contain of name1_dos.  Thank you very
much.  

Vice versa, I will @echo %name1_dos% > t4.txt in batch
file, then use perl script filehandler to read t4.txt
and assign to $name1_perl.  If you have better way,
please let me know.  Thanks again

--- Alfred Wheeler <[EMAIL PROTECTED]>
wrote:
> I'm not sure this answers your question... However -
> 
> #!perl
> open IT, ">mybat.bat";
> print IT "\@echo off\n";
> print IT "echo Hello World!\n";
> close IT;
> system ( "mybat.bat" );
> 
> - Original Message - 
> From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> To: "A. Rivera" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Friday, November 09, 2001 4:37 PM
> Subject: Re: How to run DOS batch files or DOS
> commands in the Perl script
> 
> 
> > Thank you very much.  I tested successfully.  One
> more
> > question that how can I transfer the variables of
> in
> > Perl Script to DOS batch or vice versa (e.g.
> > "$name1_perl=..." in Perl; "set name1_dos=..." in
> DOS
> > Batch)
> > 
> > --- "A. Rivera" <[EMAIL PROTECTED]> wrote:
> > > system("batchfile.bat");
> > > 
> > > - Original Message - 
> > > From: "Jason-Yahoo" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Friday, November 09, 2001 4:09 PM
> > > Subject: How to run DOS batch files or DOS
> commands
> > > in the Perl script
> > > 
> > > 
> > > > I can run perl script in the DOS batch file
> e.g.
> > > > 
> > > > 
> > > > @echo Next line will run Perl Script
> > > > perl perl_sample1.pl
> > > > 
> > > > 
> > > > 
> > > > But, how can I run DOS batch files or commands
> and
> > > > executable file in the Perl script.  Please
> give
> > > me example.
> > > > 
> > > >
> __
> > > > Do You Yahoo!?
> > > > Find a job, post your resume.
> > > > http://careers.yahoo.com
> > > > 
> > > > -- 
> > > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > > 
> > > > 
> > > 
> > > 
> > > -- 
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Find a job, post your resume.
> > http://careers.yahoo.com
> > 
> > -- 
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > 
> 
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: how to run Perl code in my own pc computer but not on server?

2001-08-08 Thread Bedford, Donald T.

I've had very good luck with ActivePerl. 
http://aspn.activestate.com/ASPN/Downloads/ActivePerl/

When installed, the executable needs to be in your PATH. Then you can run it
with "perl yourstript.pl" or whatever... Be sure to read the FAQ first.

-don

-Original Message-
From: Kehai Li [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 4:09 PM
To: [EMAIL PROTECTED]
Subject: how to run Perl code in my own pc computer but not on server?


how to run Perl code in my own pc computer but not on server?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




HOW TO: Run perl script from CD on machine that does not have perl installed

2002-10-01 Thread Nathan Bigger

I'm trying to setup an autorun process on a CD that will run a perl script and output 
to a web browser.
The CD will be used on Win32 machines that do not have Perl installed.  The perl 
binaries and library
files are on the CD.  I have determined that I can run a batch file from the command 
line that will add
the perl binaries directory to the path and then run perl.exe against the .pl file.

Doing this results in the output from the perl script being displayed in the command 
prompt window.
What do I have to do to get the output to open a browser window and display in html 
format?  My
perl script is included below:
# ###
# first test program
# ###
#

$found = 1;
$count = 0;
$userid=cduser;

#
# send back HTML document applicable for USERID/PASWORD
#
if ($found eq 1) {
   #print contents
   $width = 540;
   $height = 580;

   print "Content-type: text/html\n\n";
   print "\n";
   print "\n";
   print "Login page\n";
   print "\n";
   print "\n";
   print "\n";

   print "\n";

   print " \n";

   print " \n";

   print " \n";
   print " \n";
   print " \n";
   print " \n";
   print " \n";
   print " \n";
   print " \n";
   print "\" \n";
   print " \n";
  
   print " \n";

   print "\n";
   print "\n";
   print "\n";
   }
exit;

Thanks for your time,
Nathan


Re[2]: How to run DOS batch files or DOS commands in the Perl script

2001-11-24 Thread Tim Musson

Hey Jason,

My MUA believes you used (X-Mailer not set)
to write the following on Friday, November 09, 2001 at 9:00:17 PM.

You can use %ENV to access the environment (variables).


foreach $env_var (sort keys %ENV) {
print "$env_var = $ENV{$env_var}\n";
}


JYh> Hi Alfred, Base on your answer, I added my idea and changed the
JYh> script as:

JYh> $name1_perl="MaryGibson";

open IT, ">>t3.bat";
JYh> print IT "\@echo off\n";
JYh> print IT "set name1_dos=$name1_perl\n";
JYh> print IT "\@echo name1_dos=%name1_dos%\n";
JYh> close IT;
JYh> system ( "t3.bat" );

JYh> The contain of $name1_per1 ,MaryGibson, is transfer to
JYh> DOS shell as contain of name1_dos.  Thank you very
JYh> much.  

JYh> Vice versa, I will @echo %name1_dos% > t4.txt in batch
JYh> file, then use perl script filehandler to read t4.txt
JYh> and assign to $name1_perl.  If you have better way,
JYh> please let me know.  Thanks again


>> 
>> 
>> > Thank you very much.  I tested successfully.  One
>> more
>> > question that how can I transfer the variables of
>> in
>> > Perl Script to DOS batch or vice versa (e.g.
>> > "$name1_perl=..." in Perl; "set name1_dos=..." in
>> DOS
>> > Batch)
>> >



-- 
[EMAIL PROTECTED]
Using The Bat! (http://www.ritlabs.com/the_bat/) eMail v1.53d
Windows NT 5.0.2195 (Service Pack 1)
Junk: stuff we throw away. Stuff: junk we keep. 


Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread benbart
Hi all,

Please note the Perl script that am trying to write at end the of this email,
after the dashes.

I have two files that contains thousands and millions of records of two database
tables that are supposed to be replicated and same "similar" amount of records
but, unfortunately, they're not.

This is what's happening:

TARGET1.LOG:
2
4
6

SOURCE1.LOG:
1
2
3
4
5
6

I place all of TARGET1.LOG into an array, then I read SOURCE1.LOG one line at a
time and do a grep against the array. If there is no match, then that means the
record does not exist and is thus not replicated and I will want to print this
into a file or maybe store it into an unmatch array temporarily and write the
whole array into a file later on.

The script does what it intends to do for small-sized file. But when I get a
file with 8million+ records that is 600MB in size. It consumes a lot of the CPU
system resource. Stripping the spaces manually via sed cuts the size down to
60MB, but it still consumes a lot of resource. So now I want to know how can I
convert this script to grep the string from a file instead of from the array.
Doing so I think will lessen the use of most of the CPU resource.

Am guessing that I have to take out the array bit and just modify this line
here:

@match=grep{/$lookfor/[EMAIL PROTECTED];

But I am not sure how or what I should change it to. How do I tell grep to
search from a file instead of from an array? Do I need to open a FILEHANDLE for
grep to search from? Also, I want to do the sed stripping of the spaces from
within Perl instead of what am currently doing which is running the sed
manually first as a separate step and then running my Perl script.

Any help will be very much appreciated. Thanks in advance.

---

#!/usr/bin/perl
my $data_file = 'target1.log';
open DATA, "$data_file" or die "can't open $data_file $!";
my @array_of_data = ;
close (DATA);
print "The array MAX index is ==> $#array_of_data ...\n";

open (DATA, "< source1.log");
while(  )
{
   #print $_;
   chomp $_;
   $lookfor=$_;

   @match=grep{/$lookfor/[EMAIL PROTECTED];
   if (@match) {
  print "MATCH :: << $lookfor >> \n";
   }
   else
   {
  print "NO-MATCH :: << $lookfor >> \n";
   }
}
close (DATA);

exit;





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to grep $string from a file? How to run sed-like commands fromPerl?

2006-08-23 Thread Dr.Ruud
benbart schreef:


[I see no direct relation of the Subject to the question.]

> I have two files that contains thousands and millions of records of
> two database tables that are supposed to be replicated and same
> "similar" amount of records but, unfortunately, they're not.

If the files are sorted, as your example suggests, just use diff.
See `man diff` for handy options like -w.

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: How to grep $string from a file? How to run sed-like commands from Perl?

2006-08-23 Thread Mumia W.

On 08/23/2006 05:09 PM, [EMAIL PROTECTED] wrote:

[...]
Am guessing that I have to take out the array bit and just modify this line
here:

@match=grep{/$lookfor/[EMAIL PROTECTED];

But I am not sure how or what I should change it to. How do I tell grep to
search from a file instead of from an array? [...]


You could use the 'Tie::File' module.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]