in reply to Help regarding regular expression

push(@a, $1) if ($line =~ /(GO:\d+)/);

Replies are listed 'Best First'.
Re^2: Help regarding regular expression
by chavanak (Initiate) on Aug 06, 2009 at 10:19 UTC
    Still not working :( I really don't know what I am doing wrong here:
    use LWP::Simple; use warnings; #use strict; my $query = shift(@ARGV); #print "$query\n"; die "waste fellow dnt know hw to write a program" unless (open(IN,">/h +ome/vivek/Desktop/test12.txt")); my $content = get("http://amigo.geneontology.org/cgi-bin/amigo/search. +cgi?query=$query;search_constraint=gp;action=query;view=query/"); die "Couldn’t get the website!" unless defined $content; print IN "$content"; print "At the whileloop\n"; while(IN) { push(my @a, $1) if (my $line =~ /(GO:\d+)/); rint "Reached"; print "@a\n"; close(IN); }
    Printing that array gives me nothing.