User Profile
Collapse
-
Thank you so much for taking out the time in helping me.. It is working.. thanks again...:)... -
Thanks for the reply KevinADC.. I modified my scripts so that all the method are "Get". But still no change in what output I get. The strange fact is that I am able to get the third variable and ,as I said above also, the entire url is correct.. I dont know why it is not getting the values into the script.....Leave a comment:
-
Retrieving values from the URL
Hi...
I have written some cgi scripts and I need to pass the user id and password between them.. There is a Login page which passes the user name and password to another cgi script through the url which in turn encrypts it and passes it to the next cgi script (again through url). The third cgi script is also able to retrieve the values (using the param method), it adds another variable to the url and passes to the next cgi script..
... -
Hi..
'>' is for opening the file in write mode and ">>" is for opening the file in append mode. So, as KevinADC has suggested,will work fine ..Code:inputfile >> outputfile
Leave a comment:
-
Hi....
The do loop you are using should have a condition to determine where the loop should stop its execution. And [CODE=perl] $guess = <STDIN>; [/CODE] should be inside the loop only.. One more change that is required is for each time the user fails to guess the number correctly you should increase the $count... Moreover, as mentioned by KevinADC, else construct does not have any conditions .With these changes the code is given below.....Leave a comment:
-
Hi Alex,
After getting the entire data into $content, you can split it line by line and store it in an array and use the same code for this array..
[CODE=perl] my @contents = split(/\n/,$content);
foreach my $line (@contents)
{
if($line =~ /id="(.*)"/)
{
push @hosts,$1;
}
}[/CODE]
...
Hope this helps.....Leave a comment:
-
Hi Mahesh,
First you have to post your code using the code tags and second you have not used [CODE=perl]use strict;
use warnings;[/CODE]
in your code.. Please follow this simple steps to ensure that people here can help you better..
Now regarding your question, you are not getting the numbers after 1999-0833 because you are considering only the first entry.. As above replied you should be using the split function.....Leave a comment:
-
Hi Jeff,
Will keep it in mind in future.. But I thought since Mercury had provided the code and all that was needed was a split function, I gave the solution.
Anyways, Thanks for the feedback :)
Thanks
Mehjabeen...Leave a comment:
-
Hi,
You should be running the awk command by enclosing it in `(back ticks).. eg [CODE=perl]`awk \'{print NF ":" $0}\'`[/CODE]
But i guess there is some syntax error in the statement.. You might get more details at this link
On the other hand, if you are not soo keen on using awk, this code also provides the same solution
[CODE=perl]#!/usr/bin/perl
use strict;
use warnings;...Leave a comment:
-
Hi..
Dont know much about this , but if you still need the solution may be you should see this node
Regards
Mehjabeen
...Leave a comment:
-
Hi Rajiv,
You have to provide more details about what you are trying to do.. But I guess you should go for pattern matching with regular expressions.
MehjabeenLeave a comment:
-
-
Thanks for the reply... But I am unable to get the changes. This is what I am trying to do
[CODE=perl]#!/usr/bin/perl
use strict;
use warnings;
require myfile.pl
%main::my_hash= (1=>"one",2=>"t wo");
foreach (keys %main::my_hash)
{
print "$_\t$main::my_ hash{$_}\n";
}[/CODE]
and myfile.pl contains
[CODE=perl]%my_hash = ();
1;[/CODE]
...Leave a comment:
-
Modifying a hash in some other file
Hi friends,
Please clear my doubt. Suppose we have a hash variable in a file, and we are accessing the same hash and adding some more keys to the hash in some other script. Will this change be reflected in the first file? Is there a way to do this so that change is reflected without deleting the old file and creating the file again with the new value?
Thanks
Mehjabeen -
Hi Vinod,
What Kevin is trying to explain is this..
Suppose you have the two dates like this Date1 : 2007/12/26 and Date2: 2007/12/26..
You pass both these to the script thru command line like this
And in the script, you can retrieve the same using the array @argv, which is used to manipulate the command line argumentsCode:perl scriptname.pl 2007/12/26 2007/12/26
[CODE=perl]#!usr/bin/perl...Leave a comment:
-
Wow... this is clean and simple to understand also..... A lot better than my 1,2,3.... :) Thanks...Leave a comment:
-
Hi Rajiv,
Why dont you use keys like 1,2,3 etc and let these keys point to the values.i.e
and in your code replace '1' by Payment Received.. I think you can maintain the order of addition by this way only.Code:1=>PR, 2=>Under processing etc
To make it simpler you can use the Tie::IxHash module. See the example here...Leave a comment:
-
Hi...
After getting the names of the files of the directory, you would have to open all these files one by one and read the contents... you can copy these contents to another file...
Try doing something like this
[CODE=perl]
#open the temporary file in append mode
open (OUT,">>temp.tx t") || die ("Cant open");
foreach $files(@files)
{
#open the files one...Leave a comment:
-
Formatting excel sheets
HI,
I am writing a code in jsp to retrieve the details from a database and saving it as excel sheet. I am first retrieving the company name and then according to the company, I am grouping the employees.
I am getting the excel sheet with all the details but I cant find a way to put some separators between the details of the two companies.This is my code
...Code:<%@ page import="org.apache.poi.hssf.usermodel.HSSFSheet"%>
-
No activity results to display
Show More
Leave a comment: