Reading Locked PDF files

2004-10-07 Thread ashish srivastava
Hi,
Has anybody read a .pdf file from a perl script? I am trying to use 
PDF::Extract module, but not able to get the o/p.
Please let me know if any one has written similar scripts?

Thanks
Ashish
_
Seized by wanderlust? Have the best vacation ever. 
http://www.msn.co.in/Travel/ Team up with MSN Travel!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Getting output from DBI->do()

2004-09-29 Thread ashish srivastava
Hi,
I have a script that tries to compile all the invalid objects in a Oracle 
db. How do i know whether the compile was successful or NOT?
i.e.

if an object dosent compile i shud display :
 "Warning: Package Body altered with compilation errors."
or if it does, "Package body altered" i.e. (output from the sql session).
How can i capture this?
Thanks
Ashish
_
Life on the fast tracks! http://server1.msn.co.in/sp04/tataracing04/ Know 
all about it!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Running a script from command line as well as browser

2004-09-01 Thread ashish srivastava
This is the code i am using :
=
#!D:\perl\bin\perl
#
# This script can be used by both web-UI as well as command line
# In command line usage, non-interactive method has to be enabled.
#
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
#$ENV{ORACLE_HOME} =  "/local/db/8.0.6";
#$ENV{TNS_ADMIN}="/findev/fin/linux/conf";
print "from web " if (defined $ENV{QUERY_STRING}) ;
if (@ARGV>0) {
	 #
	 # Called from command line
	 #
	 if ($#ARGV+1<3) {
		 usage();
		 exit(1);
	 }
	 $SIG{'INT'} = 'handler';  # ^C handler
	 print "Called from Command line\n";
	 get_params();
print 
$env,$schema_name,$schema_pwd,$action,$invalids_only,$object_name_like;
	 print "\n",$init_inv_file_name_loc,$final_inv_file_name_loc,"\n";
}
elsif ($ENV{CONTENT_LENGTH} || $ENV{QUERY_STRING}){
print "Content-type:text/html\n\n";
	 print "Called from WebUI";
	 get_params();
	 print 
$env,$schema_name,$schema_pwd,$action,$invalids_only,$object_name_like;
}
#else {
#	 usage();
#	 exit(1);
#}

###
#  
   
#
#   Function 
Definition Starts Here 
  #
#  
   
#
###
#
# get_params(). Initializes all the variables used in the script.
#
sub get_params(){
	 if ($ENV{CONTENT_LENGTH} || $ENV{QUERY_STRING}) {
	 	 my $page=new CGI;
		 #print $page->param('db');
		 $env=$page->param('db');
		 $schema_name=$page->param('username');
		 $schema_pwd=$page->param('password');
		 $action=$page->param('opt');
		 $invalids_only=$page->param('invalids_only');
		 $object_name_like=$page->param('name');
		 $action=($action eq 'Compile')?'-c':'-g';
		 $invalids_only=($invalids_only =~/^y/i)?'Y':'N';
	 }
	 elsif (defined @ARGV){
		 $action=lc($ARGV[0]);
		 $env=lc($ARGV[1]);
		 $schema_name=lc($ARGV[2]);
		 #
		 # The fourth param can be a Y for disp or a file name
		 #
		 if (lc($ARGV[3])=~/^y/i) {
			 $disp_on_scr=(lc($ARGV[3]) eq 'y') ? 1 : 0;
			 $defaults_file=$ARGV[4];
		 }
		 elsif (-f $ARGV[3]) {
			$defaults_file=$ARGV[3];
		 }
		 #
		 # Check if the defaults file exist. If it exists continue in 
non-interactive mode
		 # If it doesnt exist, ask user to continue or exit. if user continues it 
in in interactive mode
		 # variable MODE=0 :- interactive mode, MODE=1 :- non-interactive
		 #
		 print "Defaults file is : $defaults_file\n";
		 if (!-e $defaults_file) {
			print "Unable to open defaults file. Please check ! \n";
			print "Error : $!\n";
			exit();
		}
		else{
			open (FILE,"<$defaults_file") || die "Opening $defaults file : $!\n";
			my @readF=;
close FILE;
foreach  (@readF) {
	push @read,$_ unless($_=~/^\#|^\n/);
}
			chomp($init_inv_file_name_loc=$read[0]);
chomp($final_inv_file_name_loc=$read[1]);
chomp($schema_pwd=$read[2]);
chomp($object_name_like=$read[3]);
chomp($underscore=uc($read[4]));
chomp($invalids_only=uc($read[5]));
chomp($cont_on_error=$read[6]);
chomp($html_enable=$read[7]);
		}
	 }
	 return;
}
###  
- 
###
#
# Usage function
#
sub usage(){
	system("clear");
   print "\nUsage : GenInvDetails.pl   [DISPLAY YES|NO] 
[DEFAULT FILE]\n\n";
	print ":\n\t-g\t: Generate a List of Invalid Objects\n\t-c\t: 
Compare with an Initial List\n\n";
   print ":\n\t\t: The Environment Name. e.g. 
nfrv159h,frf1154b\n\t\t: The Schema Name. e.g. apps, apps_mrc\n\n";
   print "[DISPLAY YES|NO]\t: Whether to display Errors on screen\n\n";
	print "[DEFAULT FILE]\t\t: Name of defaults file (with full path), to 
execute in non-interactie mode\n\n";
}
###  
----- 
###

===
This works fine from command line, but when called from a browser, openes a 
file save dialog box. When i say open to the dailog bix i see

Running a script from command line as well as browser

2004-09-01 Thread ashish srivastava
Hi,
I have a script which takes some values from a user(interactively e.g. enter 
value for ..). Now i need to make a provision that this script be run from a 
UI where the user inputs all the values in the form.
presently i am checking whether @ARGV or $ENV{CONTENT_LENGTH} is defined or 
not. IF @ARGV is defined i understand that the script has been called from 
command line and if
$ENV{CONTENT_LENGTH} is defined i know that it has been accessed by a 
browser.

IS THIS CORRECT?
I am using :
if (defined @ARGV) {
}
elsif (defined $ENV{CONTENT_LENGTH} || defined $ENV{QUERY_STRING}){
}
Any pointers?
Thanks
Ashish
_
Claim your Citibank Ready Cash today. 
http://citibank.mediaturf.net/pl/save_lp.jsp?referrer=Hmtgofline It’s fast, 
easy and affordable.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Running a script from command line as well as browser

2004-08-26 Thread ashish srivastava
Hi,
I need to run a script either from a command line or from a web ui. The 
script takes some command line arguments. At present i have created a soft 
link from the cgi-bin dir to the actual location of the script. But how do i 
pass the command line args from the UI?
Do i need to use JavaScript?

Thanks
Ashish
_
Marriage by choice http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto 
Shaadi.com.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Running a script non-interactively.

2004-08-19 Thread ashish srivastava
Hi Everyone,
I have a script that prompts a user for some values (dir. location, file 
name etc). I have a requirement that this script be run in a non-interactive 
mode also. That is the user stores his inputs in a text file and gives the 
location of the defaults file as a command line arg.
How can i achieve this without significant change to the code? Is there a 
way to replicate a user input?

Thanks
Ashish
_
Block annoying pop ups! Empower your search! 
http://server1.msn.co.in/features04/general/MSNToolbar Enrich your internet 
experience!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Help needed in Perl/LWP

2004-07-13 Thread ashish srivastava
hi,
i am running the same script that u gave(with some minor modifications) but 
i am unable to get the result e.g.

main prog(to be automated):

#!D:\perl\bin\perl
use CGI::Carp qw(fatalsToBrowser);
require "./cgi-lib.pl";
&ReadParse();
print "Content-type:text/html\n\n";
print <<"HTML";

 My LWP/Mechanize example






 
HTML
$action=$in{'f3'};
print "Action si : $action";
if ($action eq "Submit") {
$t1=$in{'f1'};
$t2=$in{'f2'};
print "Values passed are : $t1   $t2";
}
===
Script which automates it
--
#!D:\perl\bin\perl
use CGI;
use LWP::UserAgent
$UA = LWP::UserAgent->new();
my $URL_Server = 'http://url.com/cgi-bin/lwp1.pl';
my $username = 'ashish';
my $password = 'srivastava';
my %fields = (f1 => $username, f2 => $password);
my $res = $UA->post($URL_Server,\%fields);
#print "Success ? ".$res->is_success()."\n"."Success is $res\n";
#print ($res->is_success) ? $res->content : $res->status_line;
print $res->content();
This prints the entire HTML page
------

 My LWP/Mechanize example






 
Action si : 

What am i missing?
THanks
Ashish
From: "Yehuda Berlinger" <[EMAIL PROTECTED]>
To: "ashish srivastava" <[EMAIL PROTECTED]>
Subject: Re: Help needed in Perl/LWP
Date: Tue, 13 Jul 2004 10:58:23 +0300
use LWP::UserAgent
my $UA = LWP::UserAgent->new
my $URL_Server = 'http://www.foo.com/barf.pl';
my $username = 'jon';
my $password = 'garbage';
my %fields = (username => $username, password => $password);
my $res = $UA->post($URL_Server,\%fields);
print ($res->is_success) ? $res->content : $res->status_line;
13 Jul 2004
> Hi,
>
> I am trying to replicate a form submit action. Will LWP be useful for
> this? i am new to LWP so dont know much about its capabilities. The form
> that i am trying to submit calls a perl program and passes some
> variables in the POST method.  The form has some text fields which the
> user fills and then clicks the submit button. The search is processed
> and the values rendered on the same page.
>
> My requirement is that my script should assign the text fields some
> values, simulate a 'submit' and then receive the output.
>
> If anybody has done something similar, please let me know
>
> Thanks
> Ashish
>
> _
> Claim your Citibank Ready Cash today.
> http://go.msnserver.com/IN/52041.asp It’s fast, easy and affordable.
>
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_
Earn without investing. http://go.msnserver.com/IN/52048.asp Sell anything 
under the sun.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Help needed in Perl/LWP

2004-07-13 Thread ashish srivastava
Hi,
I am trying to replicate a form submit action. Will LWP be useful for this? 
i am new to LWP so dont know much about its capabilities.
The form that i am trying to submit calls a perl program and passes some 
variables in the POST method.  The form has some text fields which the user 
fills and then clicks the submit button. The search is processed and the 
values rendered on the same page.

My requirement is that my script should assign the text fields some values, 
simulate a 'submit' and then receive the output.

If anybody has done something similar, please let me know
Thanks
Ashish
_
Claim your Citibank Ready Cash today. http://go.msnserver.com/IN/52041.asp 
It’s fast, easy and affordable.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: AW: Formatting Error Messages

2004-05-18 Thread ashish srivastava
Thanks Bill .. that's working now!
Output 
(asrivast) test- perl p1.plDBI connect('frf1154a','scott',...) failed:  at p1.pl line 5 ORA-01017: invalid username/password; logon denied (DBD: login failed)
ashish
>From: "$Bill Luebkert" <[EMAIL PROTECTED]> >To: ashish srivastava <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: AW: Formatting Error Messages >Date: Tue, 18 May 2004 03:23:20 -0700 > >ashish srivastava wrote: > > > My script : > > > > #!/local/bin/perl > > > > use DBI; > > $ENV{ORACLE_HOME} = "/local/db/8.0.6"; > > my $dbh = DBI->connect("DBI:Oracle:frf1154a","scott","tiger") > > or die "$! \n".DBI->errstr; > > > > Output : > > > > (asrivast) test- perl p1.pl > > DBI connect('frf1154a','scott',...) failed: at p1.pl line 5 > > > > ORA-01017: invalid username/password; logon denied (DBD: login failed) > > at p1.pl line 5. > >Duh - there is no newline at the end dude. Try: > > or die "$! \n" . DBI->errstr . "\n"; > >-- > ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
 elphia.net > (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ >-/-' /___/_<_ Apply to 50,000 jobs now. Post your CV on naukri.com today. 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: AW: Formatting Error Messages

2004-05-18 Thread ashish srivastava
My script :
#!/local/bin/perl 
use DBI;$ENV{ORACLE_HOME} =  "/local/db/8.0.6";my $dbh = DBI->connect("DBI:Oracle:frf1154a","scott","tiger")   or  die "$! \n".DBI->errstr;Output :
(asrivast) test- perl p1.pl DBI connect('frf1154a','scott',...) failed:  at p1.pl line 5 ORA-01017: invalid username/password; logon denied (DBD: login failed) at p1.pl line 5.Ashish
>From: "$Bill Luebkert" <[EMAIL PROTECTED]> >To: ashish srivastava <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: Re: AW: Formatting Error Messages >Date: Tue, 18 May 2004 02:34:29 -0700 > >ashish srivastava wrote: > > > Hi, > > > > I also read somewhere that appending a "\n" will suppress the script > > name and line number. But that dosent seem to work in my case. I have > > already added the \n to the die(). > >I think you're wrong. Show us a small failing example exactly as >you ran it. > >-- > ,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED] > (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] > / ) /--< o // // Castle of Medieval Myth & Magic http://www.todbe.com/ >-/-' /___/_<_ Apply to 50,000 jobs now. Post your CV on naukri.com today. 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Setting Linux Env Variables from Perl script

2004-05-11 Thread ashish srivastava
Hi,
Is there a method by which we can permanently define an env variable from a perl script? I mean i define a variable and set its value in a script. And i can access the variable even if i quit the script?
I have tried using the system("setenv VAR var_value"); but this dosent work.
#!/local/bin/perl -w
print "Before setting ".$ENV{'VAR1'},"\n";system("setenv VAR1 Ashish"); print "After Setting ".$ENV{'VAR1'},"\n";## this just sets the variable as long as the script is running ##$ENV{'VAR1'}="Ashish";$e1=$ENV{'VAR1'};print "Env Variale is $e1\n";##
 
Any pointers?
 
Thanks
Ashish
 
Send flowers in 24 hours!  At MSN Shopping. 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


DBI Question

2004-01-30 Thread ashish srivastava
Hi
Is it possible to get the names of the columns which a user has selected? I mean suppose a user writes a query as :
select ename,deptno,sal from emp;
then can we print the column name(ENAME,DEPTNO,SAL) ?
Thanks
Ashish
 
 
 
Easiest Money Transfer to India.  Send Money To 6000 Indian Towns. 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Problem running different versions of Perl

2004-01-07 Thread ashish srivastava
Hi Paula,

We tried to use both the approaches i.e. perl  and  . 
But no luck. I have included the entire @INC of perl5.8 in my script.
I really dont understand why this is happening. :(

Ashish


From: "Capacio, Paula J" <[EMAIL PROTECTED]>
To: "ashish srivastava" 
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: Problem running different versions of Perl
Date: Tue, 6 Jan 2004 15:41:34 -0600

>Ashish Srivastava wrote:
>Sent: Monday, January 05, 2004 11:37 PM
>We have perl 5.6 and perl 5.8 installed on our server. Perl 5.6 dosent
have
>Telnet.pm module installed but perl 5.8 has. So in my script i have
used the
>location of v5.8 and it is running fine. But the script errors out when
>other user try it from their logins. The error they get is :
>
>Can't locate Net/Telnet.pm in @INC (@INC contains:
>/local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1
>/local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux
>/local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .
>
>The shebang line of my script is :
>#!/local/perl5.8/bin/perl   (using perl 5.8 installation)
>How to make the script run for other users? Do i need to change the
@INC?
Ashish,
How are the others executing your script?  It's been my experience that
the shebang line only counts when using the .pl association for
execution.
Meaning:
./script.pl <---will use the shebang line in the script
perl script.pl  <---will use whatever perl is related to regardless of
shebang
on my AIX server that is perl -> /usr/opt/perl5/bin/perl5.00503
Perhaps the others are typing 'perl' and it relates to version 5.6.1 at
your
shop.  Just a stab in the dark...hope it helps.
Paula

_
Games, MMS cards, ringtones. Operator logos, picture messages & more. 
http://server1.msn.co.in/sp03/mobilesms/ Jazz up your mobile!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


DBI errors

2003-07-18 Thread ashish srivastava
Hi,

I am writing a simple query which is failing:
The query and the error is :
QUERY
=
use DBI;
$dbh = DBI->connect('DBI:Oracle:reldb','rnd','welcome')
  or die "Couldn't connect to Local database: " . DBI->errstr;
$GET_ARU_FAILURES << "EOU";
SELECT 
b.product_abbreviation,a.bug_number,e.status,f.release_name,c.platform_short_name,d.description
FROM [EMAIL PROTECTED] a, [EMAIL PROTECTED] 
b,[EMAIL PROTECTED] c, [EMAIL PROTECTED] d, [EMAIL PROTECTED] 
e,[EMAIL PROTECTED] f
WHERE b.product_id=a.product_id
   and a.product_id in (SELECT product_id from [EMAIL PROTECTED] 
where product_abbreviation like ?)
   and a.status_id in (55,62)
   and c.platform_id=a.platform_id
			and d.status_id=a.status_id
			and e.rptno=a.bug_number
			and f.release_id=a.release_id
	  ORDER by b.product_abbreviation

EOU

$vget_aru_failures = $dbh->prepare_cached($GET_ARU_FAILURES)
or die "Couldnt prepare query ". DBI->errstr;
.
.
.
.
.


ERROR

Backslash found where operator expected at Noname1.pl line 10, near 
"aru_bugfix_requests\"
Backslash found where operator expected at Noname1.pl line 10, near 
"@arudb\"
   (Missing operator before \?)
Bareword found where operator expected at Noname1.pl line 10, near "%20a"
   (Missing operator before a?)
Backslash found where operator expected at Noname1.pl line 10, near 
"aru_products\"
Bareword found where operator expected at Noname1.pl line 10, near "@arudb 
b"
   (Missing operator before b?)
Backslash found where operator expected at Noname1.pl line 10, near 
"aru_platforms\"
Bareword found where operator expected at Noname1.pl line 10, near "@arudb 
c"
   (Missing operator before c?)
Backslash found where operator expected at Noname1.pl line 10, near 
"aru_status_codes\"
Bareword found where operator expected at Noname1.pl line 10, near "@arudb 
d"
   (Missing operator before d?)
Backslash found where operator expected at Noname1.pl line 10, near 
"rpthead\"
Bareword found where operator expected at Noname1.pl line 10, near "@bugdb 
e"
   (Missing operator before e?)
Backslash found where operator expected at Noname1.pl line 10, near 
"aru_releases\"
Bareword found where operator expected at Noname1.pl line 10, near "@arudb 
f"
   (Missing operator before f?)
Bareword found where operator expected at Noname1.pl line 12, near "@arudb 
where"
   (Missing operator before where?)
syntax error at Noname1.pl line 10, near "aru_bugfix_requests\"
Execution of Noname1.pl aborted due to compilation errors.

_
It's new, it's here! It's full of fun! 
http://server1.msn.co.in/sp03/messengerpromo/index.asp MSN Messenger V6.0

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


(no subject)

2003-07-01 Thread ashish srivastava
Hi
Apologies if this question has been asked before or this is not the correct 
mailing group.

I want to create a form for the user to fill in data and this data should 
populate some table in my database.
How do we this ?

Thanks
Ashish
_
MSN give you more space! 5 times more storage. 
http://join.msn.com/?page=dept/home&pgmarket=en-xu Do more for less.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: HElp needed

2003-06-21 Thread ashish srivastava
Another doubt
Suppose i create a link to a file... now when the user clicks on this the 
file should open to show its contents (either in a new window or in thew 
same one).. how to do this??

Rgds
Ashish


From: "$Bill Luebkert" <[EMAIL PROTECTED]>
To: ashish srivastava <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: HElp needed
Date: Fri, 20 Jun 2003 23:04:47 -0700
ashish srivastava wrote:
> Hi,
> My application needs to create an HTML page which shows all the 
directories
> and files(UNIX platform).
> The file/dirs should have a link that should take them to the direc. or 
if
> it id a file  it should open  it.
> At present i am doing this by doing 'ls', storing the output in an array 
and
> then printing the array..
> But how do i go to the next level of dir(or open the file) once the user
> clicks on his choice?
> I was thinking of passing the selected object name to another perl 
program
> which will do the 'ls' and print the o/p.
> Please suggest how to go about doing this..
> Also, i cannot use CGI.pm module
>
> Any sortof help would be greatly appreciated.

Without CGI, you would be forced to use ASP/JS/?? that would be embedded
in the HTML (which may not allow for what you want [not an expert]).
If you have an Apache server, just let the server handle it by making
sure you don't have an index.html and that you have Indexes turned on
in the httpd.conf or .htaccess file.
">
Options Indexes

--
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic 
http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (Free site for 
Perl/Lakers)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_
Gift yourself a holiday. Treat your family like royalty. 
http://www.flexihols.com/2003/index.php

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


IDE for Perl/CGi

2003-06-17 Thread ashish srivastava
Hi
Anybody knows of a good IDE for PERL/CGI development (freeware of course ;) 
). Please provide the link to it.

Thanks
Ashish
_
Wedding blues? Need help? http://www.msn.co.in/Matrimony/
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Stuck in Find::File

2003-06-14 Thread ashish srivastava
HI

I am trying to log on to  my unix server (from my windows m/c) and list the 
directory structure. I came across this File::Find module . It works fne on 
my windows m/c. but when i try to telnet to my unix m/c and set the base dir 
as xxx it gives the following error

"Can't stat /home/: No such file or directory".
If i just give a "ls " command on the samr dir it works fine.
the code used is as follows:
Code
===
find(\&edits, $basedir);
sub edits()
{
print "File name is $_\n\t\tFull path is $File::Find::name\n";
}
where $basedir is the home directory.
Also is it possible to traverse each directory one by one?
TIA

Ashish

_
Looking for love? Yearning for friendship? http://www.msn.co.in/Romance/ 
You're in the right place

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Help needed -- Net::telnet gives errors

2003-06-13 Thread ashish srivastava
Hi Ibrahim
Thanks for ur help !
I am able to connect to the UNIX server using Prompt=>'/[\w]$-/' (the login 
being the user id with which the person has logged in eg. "tom-" ). But 1 
more prob.
i have an application in which this perl script is being called by an HTML 
form (the usual Login screen ) and the login pwd is passed to the perl 
script

This is my code for the HTML form
==


 Login Screen


 User Log in Screen 


action="/cgi-bin/telp.pl" method="GET" >

User id  :    


Password :
 
     





And this is the Perl code

use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Net::Telnet();
print "Content-type:text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/,$buffer);
print " @pairs \n";
$j=0;
foreach $pair (@pairs) {
   ($name, $value) = split(/=/, $pair);
   $value =~ tr/+/ /;
#($dummy,$name)= split(/?/,$name);
   $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
   $FORM{$name} = $value;
$info[$j]= $value;
$j++;
}
$t = new Net::Telnet (Timeout => 10, Prompt 
=>'/-/i',input_log=>'D:\server\logs\inputlog.txt');
$t->open("xxx..xxx.xxx") or die "Server not found \n";
   $t->login($usr, $pwd);
		@lines = $t->cmd("ls -l");
		foreach $temp(@lines)
		{
   print "$temp";
		}

==> The problem is that when i clik submit in the login screen, it dosent 
paas the usrname nad pswd to the perl prog. I dont understand why this is 
happening.
Please help.

Regards
Ashish
From: ibrahim <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: "'ashish srivastava'" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: RE: Help needed -- Net::telnet gives errors
Date: Sat, 14 Jun 2003 06:18:40 +0300
I used to get this type of error if the server was off or has some other
problem. However, the I got the following code from this board and it is
working excellent over about 80-90 switches-servers except some switches
where login code worked fine but the switch require pressing enter after
login and this what I could not solve it until now (send enter key or
any key to this type of switch after login). Please let me know if I can
help. Thank you.


use Net::Telnet;

$telnet = new Net::Telnet (Timeout => 20, Prompt => '/[%#>\]\/] *$/');

$out='C:\Result.txt';

open OUT, ">>$out" or die "Cannot open $out for append :$!";

$telnet->open('XX.XXX.XXX.XXX');

$telnet->login('user','user');



@lines= $telnet->cmd("ipmac");

print OUT @lines,"\n";

for ($X=0; $X <= $#lines; $X++) {

@lines=$telnet->cmd(" ");

print OUT @lines,"\n";

}

close OUT;

$telnet->close;



-Original Message-
From: ashish srivastava [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2003 7:19 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Help needed -- Net::telnet gives errors


 <http://www.herohonda.com/karizma>

_
Horror films in Bollywood. Are they worth it? 
http://server1.msn.co.in/features/horror/index.asp  Get all the dope!

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs