Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Populating an array from a mysql select

by Nik (Initiate)
on May 04, 2007 at 19:43 UTC ( [id://613649]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Populating an array from a mysql select
in thread Populating an array from a mysql select

An array reference is actually a pointer(as we would have said in C++) that points to the starting memoery location of the array?! And de-reference means to point to the value of memory location instead of the memory location itself?

Also this: my @titlelist; open FILE, "<$ENV{'DOCUMENT_ROOT'}/data/vault/titlelist.txt" or die $!; @titlelist = <FILE>; close FILE; print br() x 3; print start_form( action=>'/cgi-bin/admin.pl' ); print table( {class=>'user_form'}, Tr( td( '&#928;&#941;&#962; &#956;&#959;&#965; &#964;&#953; &#95 +2;&#945; &#942;&#952;&#949;&#955;&#949;&#962;:' ), td( popup_menu( -name=>'title' -values=>\@titlelist ))), Tr( td( '&#922;&#940;&#964;&#953; &#940;&#955;&#955;&#959; &#960 +;&#959;&#965; &#952;&#945; &#942;&#952;&#949;&#955;&#949;&#962; &#957 +;&#945; &#963;&#967;&#959;&#955;&#953;&#940;&#963;&#949;&#953;&#962;? +' ), td( textarea( -name=>'remark', -rows=>4, -columns=>25 ))), Tr( td( '&#932;&#959; &#964;&#951;&#955;&#941;&#966;&#969;&#957; +&#959; &#949;&#960;&#953;&#954;&#959;&#953;&#957;&#969;&#957;&#943;&# +945;&#962; &#963;&#959;&#965; &#947;&#953;&#945; &#949;&#960;&#953;&# +946;&#949;&#946;&#945;&#943;&#969;&#963;&#951; &#949;&#943;&#957;&#945;&#953;:' ), td( textfield( -name=>'phone' )) +), Tr( td( a( {href=>'/cgi-bin/show.pl?name=showbook'}, font( {size=>3, color=>'yellow'}, '&#917;&#956;&#966;&#940;&#957;&#95 +3;&#963;&#951;!' ))), td( submit( '&#913;&#960;&#959;&#963;&#964;&#959;&#955;&#942 +;!' ))) ); print hidden(-name=>'date', -value=>$date); print hidden(-name=>'host', -value=>$host); print end_form();
Although @titlelist is filled with all entries from titlelist.txt file(one entry per line), when it gets printed with popup_menu it displays nothing at all!!

Replies are listed 'Best First'.
Re^5: Populating an array from a mysql select
by Fletch (Bishop) on May 04, 2007 at 19:53 UTC

    Pointers and references are similar but distinctly different beasts; for example pointers can be manipulated (e.g. you add one to get to the next item), whereas references are opaque (it doesn't make sense to say $array_ref += 1). A read of perlreftut may be in order before reading perlref.

      Pointers and references are similar but distinctly different beasts

      I have a strange sensation, just as if I had already answered that question elsewhere. But I'm getting tired pointing out so.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://613649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-19 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found