User Profile

Collapse

Profile Sidebar

Collapse
mehj123
mehj123
Last Activity: Nov 8 '08, 02:21 AM
Joined: Aug 22 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mehj123
    replied to Retrieving values from the URL
    in Perl
    Thank you so much for taking out the time in helping me.. It is working.. thanks again...:)...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Retrieving values from the URL
    in Perl
    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.....
    See more | Go to post

    Leave a comment:


  • mehj123
    started a topic Retrieving values from the URL
    in Perl

    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..
    ...
    See more | Go to post
    Last edited by mehj123; Mar 12 '08, 04:13 AM. Reason: corrected typo

  • mehj123
    replied to input to file
    in Perl
    Hi..

    '>' is for opening the file in write mode and ">>" is for opening the file in append mode. So, as KevinADC has suggested,
    Code:
    inputfile >> outputfile
    will work fine ..
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Help with Incrementing
    in Perl
    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.....
    See more | Go to post

    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.....
    See more | Go to post

    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.....
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to line number and first occurence of a pattern
    in Perl
    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...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to line number and first occurence of a pattern
    in Perl
    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;...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Reading PDF file using Perl CGI
    in Perl
    Hi..
    Dont know much about this , but if you still need the solution may be you should see this node

    Regards
    Mehjabeen

    ...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Help on Edit a line in a File
    in Perl
    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.

    Mehjabeen
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Modifying a hash in some other file
    in Perl
    Thanks a lot for your reply.... :)...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Modifying a hash in some other file
    in Perl
    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]
    ...
    See more | Go to post

    Leave a comment:


  • mehj123
    started a topic Modifying a hash in some other file
    in Perl

    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
    See more | Go to post

  • mehj123
    replied to Date Difference between two dates
    in Perl
    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

    Code:
    perl scriptname.pl 2007/12/26 2007/12/26
    And in the script, you can retrieve the same using the array @argv, which is used to manipulate the command line arguments
    [CODE=perl]#!usr/bin/perl...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Help On Hashes
    in Perl
    Wow... this is clean and simple to understand also..... A lot better than my 1,2,3.... :) Thanks...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Help On Hashes
    in Perl
    Hi Rajiv,
    Why dont you use keys like 1,2,3 etc and let these keys point to the values.i.e
    Code:
    1=>PR,
    2=>Under processing etc
    and in your code replace '1' by Payment Received.. I think you can maintain the order of addition by this way only.
    To make it simpler you can use the Tie::IxHash module. See the example here...
    See more | Go to post

    Leave a comment:


  • mehj123
    replied to Reading Files From Directories
    in Perl
    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...
    See more | Go to post

    Leave a comment:


  • mehj123
    started a topic Formatting excel sheets
    in Java

    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"%>
    ...
    See more | Go to post

  • mehj123
    replied to attaching files to posts
    in Perl
    Hi....

    Got the answer form one of the posts here.. Thanks...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...