perl help required


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl help required
# 1  
Old 04-08-2007
Question perl help required

hi
previously this program used to ask for user input to perform operation so
i have done the modifications but problem is that i have to create new file and redirect that file as input to this file and i want to avoid that so i made following modifications in program and i am not sure if its correct ( i dont hv perl compiler ) rather than redirecting input from other file, specify it as 1st argument and then inside program open that file read it and do the operation.

following is the code ::

my ($FILE) = "./$1" ;
open (FILE) or die "can`t open $FILE: $! \n";
my ($line1) = <FILE> ;
if (!($line1 =~ /^\d+$/)){
print "\n teller no must be an integer\n";
exit 0 ;
} else {
... do the specified thing.....
}


guys plz tell me which perl compiler i can use on windows to test my programs
# 2  
Old 04-08-2007
Quote:
Originally Posted by zedex
guys plz tell me which perl compiler i can use on windows to test my programs
http://www.activestate.com/products/activeperl/
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script required for processing the data

I have following result.log file (always has 2 lines) which I need to process, cat result.log name.cmd.method,"result","abc","xyz"; name="hello,mine.12345,"&"tree"&" xyz "&" tree "&" xyz", data="way,"&" 1"&"rate-me"&"1"&"rate-me",str="",ret=""; now I need to extract the strings/data as... (4 Replies)
Discussion started by: perlDiva
4 Replies

2. Shell Programming and Scripting

Pattern Matching and extracting the required fields in Perl

Hi All, I am writing the following Perl Scrip and need your help in Pattern matching : I have the following Shell Script that would read line by line from the file (file_svn) and would inturn calls the Perl Script: #!/bin/bash perl_path="/home/dev/filter"... (2 Replies)
Discussion started by: filter
2 Replies

3. Shell Programming and Scripting

PERL: Help required exact match

Hello, My requirement is to iterate over all the lines of a file and compare them with a word and perform some operations if exact match is found. For the snippet below, it works even if contents of line include "diff" and "diff:". I want it to work only if it is exactly "diff" and is not... (2 Replies)
Discussion started by: sarbjit
2 Replies

4. UNIX for Advanced & Expert Users

Perl parsing help required.

Hello, I got a file like this. 5201 5202 5203 5204 1234 2345 3456 4567 6210 6220 6230 6240 The required output should be 5201 1234 6210 (9 Replies)
Discussion started by: suverman
9 Replies

5. Shell Programming and Scripting

Required help in perl regular expression substitution for this date format

Hi, I have written a small perl script to handle particular date format using perl, but it is not substituting the whole string. Can some one please check on what is the issue with the code. $_ = "Date: November 25, 2010 09:02:01 PM";... (1 Reply)
Discussion started by: sarbjit
1 Replies

6. Shell Programming and Scripting

Help required in Building an XML using SAX Parser in perl

I want to use sax parser for my application as i have 5 Lakhs of data. I have the xml file like this <Nodes> <Node> <NodeName>Company</NodeName> <File>employee_details.csv</File> <data>employee_data.txt</data> <Node> <NodeName>dummy</NodeName> ... (8 Replies)
Discussion started by: vanitham
8 Replies

7. Shell Programming and Scripting

Help required converting XSD to XML file in PERL

Hi, Please find below the xsd. <?xml version="1.0" encoding="ISO-8859-1" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="fruitorder"> <xs:complexType> <xs:sequence> <xs:element name="orderperson"... (2 Replies)
Discussion started by: vanitham
2 Replies

8. Shell Programming and Scripting

perl required output

Hi, I have a string in log file from that i need to pick the username. the string is like this-- pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid... (5 Replies)
Discussion started by: namishtiwari
5 Replies

9. UNIX for Advanced & Expert Users

Perl - Help required

I am trying to upload a file to a SQL database table. The column type is IMAGE. I am looking for a solution to upload a word doc file. I tried 3 approaches. 1) my $fileToStore = "mytest.doc"; open IPFILE, "<", $name; binmode IPFILE; while (<IPFILE>) { $fileToStore .= $_; } close IPFILE;... (1 Reply)
Discussion started by: b.paramanatti
1 Replies

10. Shell Programming and Scripting

Perl Script required...

Hi All, Windows Platform. Perl Scripting. I have a file called 'hostnames.txt' contains hostname entries one by one line. Script has to perform the following command for each entry in that file. ovtopofix -G <hostname> Please anybody give me the script on this requirement. Thanks,... (1 Reply)
Discussion started by: ntgobinath
1 Replies
Login or Register to Ask a Question