How to Perl Code in Windows?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to Perl Code in Windows?
# 1  
Old 05-03-2010
MySQL How to Perl Code in Windows?

I got this perl code for solaris from tyler_durden

Please help me to run the same on windows as i am unable to install date::calc program on unix
Code:
perl -F, -M"Date::Calc qw(Add_Delta_DHMS)" -lane '
   if ($ARGV eq "file2") {
     $os{$F[0]} = $F[1].join($F[1], unpack("A2A2",$F[2]));
   } else {
     @x = unpack("A4A2A2A2A2A2",$F[2]);
     if (defined $os{$F[3]}) {
       @x = Add_Delta_DHMS(@x,0,substr($os{$F[3]},0,3),substr($os{$F[3]},3),0);
     }
     printf("%s,%s,%04d%02d%02d%02d%02d%02d,%s,%s\n",$F[0],$F[1],@x,$F[3],$F[4]);
   }
 ' file2 file1


Last edited by ssantoshss; 05-03-2010 at 04:31 AM..
# 2  
Old 05-03-2010
Which perl interpreter are you using? The -M loads a perl module called Date::Calc that adds some functionality outside of regular perl. You will most likely have to follow your perl interpreters documentation on how to install modules. If you don't have one I recommend running the real perl using cygwin. If that isn't an option strawberry perl is ok.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl-extraction using windows cmd

Hi, I need to extract Password expires from the output of windows command print `net user %USERNAME% /domain`; in perl. So i want to redirect the output of this win-cmd to a file and try extracting Password expires along with its value. i'm trying with this code but getting errors. #!usr/bin/perl... (1 Reply)
Discussion started by: sam_bd
1 Replies

2. Shell Programming and Scripting

perl script to traceroute an IP from windows

I am writing a perl code(windows) to traceroute IP address and to print the output. I had executed the below code which was taken from cpan modules #!C:/perl/bin/perl.exe use Net::Traceroute; $tr = Net::Traceroute->new(host=> "google.com"); if($tr->found) { my $hops = $tr->hops; if($hops... (4 Replies)
Discussion started by: giridhar276
4 Replies

3. Shell Programming and Scripting

Advanced perl help in windows

Hi guys, Im trying to write a perl code to do the following task. prerequisites:- 1) some media files(say boys.mp3 or gaga.mpeg or snoop.flv) is located in C:\videos\ 2) The perl code is also located in same location C:\videos\ when I execute this perl code, it should ask for a number... (4 Replies)
Discussion started by: srijith
4 Replies

4. UNIX for Dummies Questions & Answers

Need help configuring Active Perl on Windows Vista.: Perl Scripting on Windows

Hi All, Need help configuring Active Perl on Windows Vista. I am trying to install Active Perl on Windows Vista. The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006 After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies

5. Shell Programming and Scripting

FTP From UNIX to WINDOWS Using PERL

Hi All, I have to write a PERL script in which I have to FTP results from UNIX to Windows Desktop. How can I do this using PERL? Thanks (1 Reply)
Discussion started by: kunal1514
1 Replies

6. Shell Programming and Scripting

Perl for Unix & Windows

Hi Even though this is unix forum, iam posting this thread as iam not sure of which forum should i post this too. I understand perl can be used in unix environment and i have used the same for automation of my processes. Eg: Open a file search the text string replace the text string close... (9 Replies)
Discussion started by: kenkanya
9 Replies

7. Shell Programming and Scripting

Merge two files in windows using perl script

Hi I want to merge two or more files using perl in windows only(Just like Paste command in Unix script) . How can i do this.Is ther any single command to do this? Thanks Kunal (1 Reply)
Discussion started by: kunal_dixit
1 Replies

8. Shell Programming and Scripting

sending mail using perl through windows

Hi all this is the code which i tried executing in windows environment to send a test mail. # Perl script to send mail on deliver complete. package SendMail; use Config; use Mail::Send; @ISA = qw(Mail::Send); sub open { my $me = shift; my $how; # How to send mail my $notused; my... (13 Replies)
Discussion started by: victorvvk
13 Replies

9. Windows & DOS: Issues & Discussions

Anyone know any good perl compilers for windows ?

Does anyone know of a Good perl compiler for windows ? i have searched google.com and a few other search engines but they havent turned up anything good. Any and all help would be appreciated (3 Replies)
Discussion started by: JeZzTeR
3 Replies
Login or Register to Ask a Question