Hello,
I would like to know if Perl parses its code in the left-to-right direction or right-to-left direction?
Could someone please help me?
Thank you,
Akino
User Profile
Collapse
-
Does Perl parse its code left-to-right or right-to-left?
-
Yes, I understand it now. Thank you. -
-
Hi Kelicula,
Thank you very much for your reply.
There is no reason for me to try to do that - I was just curious.
Now, I understand that a value in a hash can only be a scalar.
AkinoLeave a comment:
-
Does Perl Always Pass Argument By Reference?
Hello,
I read on one web page that Perl always passes its arguments by reference.
But on another web page, it was said that Perl can pass its argument by
value :
Code:printHash(%hash);
Thank you - Akino -
Hash of Arrays
Hello,
I read in a book that I can create a hash of arrays like this :
Code:%hash = ( "testA" => [77,88], "testB" => [90, 91] );
My question is can I set it up so that each key is associated with
an array - not a reference to an array?
I have tried :
Code: -
What is the meaning of the vertical bar when used with m?
Hello,
I am trying to understand the following line of Perl code :
Code:($a_month, $a_day, $a_year) = $a =~ m|(\d\d?)/(\d\d?)/(\d{4})|;
Could someone... -
(Perl/Regex) Match a Repeated Group of Characters
Hello Everyone,
Could you please help me with one question? I have a line of text :
akinot:x:1240:1 240:Tomeri Akino
And I would like to capture 'akinot' in $1, 'x:1240:1240:' in $2, and 'Tomeri' in $3
If I write :
Code:$line =~ /(\w+):((\w+:){3})(\w+)/
-
Perl and Regular Expression Repetition
Hello,
I read on the web that the regular expression /o{2,3}/ means that it would match if o repeats at least 2 times but not more than 3 times. But when I tested this RE
with "halloooo", it returned a match.
I wonder if someone could please help me understand why it returned a match when there was 4 occurences of o?
Thank you,
Akino -
Insert Into a Binary Tree in Java
Hello,
I am new to Java and have a question I wonder if someone could please help?
I have the following code to insert into a binary tree :
Code:public void insert(int data) { root = insert (root,data); } /* recursive helper */ private Node insert(Node node, int data) { if (node == null) node = new Node(data); else if (data
-
Comparing 2 Strings Using >
Hello,
I am new to Perl. And I am trying the following code:
Code:if ( "ape" > "aaxxxx" ) { print "Greater\n"; } else { print "Not greater\n"; }
Thank you so much for your help - Akino -
Fibre Channel Simplex Cable - Which end is RX or TX?
Hello,
I am new to Fibre Channel and I have a question I wonder if someone could please help.
If I have a Fibre Channel simplex cable, is there a way to tell which end is TX and which end is RX? Or would it work if I use either end for TX or RX?
Thank you so much in advance,
Akino -
Akino877 started a topic Perl/Regular Expression how to match any number of words followed by a number?in PerlPerl/Regular Expression how to match any number of words followed by a number?
Hello,
I am new to regular expression and wonder if someone could please help me with matching any number of words followed by a number.
I've tried the following :
$str = "aaa bbb ccc -45";
while ($str =~ m/(\w+)+|-?\d{1,2}$/g) {
print $1;
}
And $1 only picked up "aaa", "bbb", "ccc" but not "-45".
... -
How to access drive/file on client machine from a web application?
Hello,
I have a problem when trying to access a file on a local client system from a web application running on the local client system.
The web application I am running can access a file on a
mapped network drive ok. But it cannot access a file on
the local client system's C: drive or on a thumb drive that is attached to the local client system.
I wonder if someone could please help me... -
Hello C CSR,
Thank you so much for your reply. Removing the extra " :
Code:<option selected="true" value="<%=item%>"><%=item%></option>
the selected item on a drop down list without adding a new item to...Leave a comment:
-
How to retain value of dropdown list when it changes?
Hello,
I have a drop-down list that I would like for it to retain the selected value (but it's not working). The following is my code :
Code:<select name="trophyscope" size="2" onChange=" <%String item = (String renderRequest.getPortletSession().getAttribute("trophyscope"); %> <option selected="true" value="<%=item%>">"<%=item%>"</option>
-
Formatted String Does Not Work When Write To A Portlet
Hello,
I have a Java formatted string which looks like the following :
PrintWriter out = renderResponse. getWriter();
...
String format = "|%1$-30s|%2$-10s|%3$-10s|%4$-10s|%5$-10s";
out.printf(form at, field1, field2, field3, field4, field5);
And I can write this formatted string to the sdtout or a file; it works fine. But when I try to write it to a portlet, the formatting... -
How to get user input in a portlet?
Hello,
I have a simple Hello World portlet, which looks like the following :
import java.io.*;
import javax.portlet.* ;
public class HelloWorldPortl et extends GenericPortlet {
public void doView(RenderRe quest request, RenderResponse response) throws IOException, PortletExceptio n {
response.setCon tentType("text/html");
response.getWri ter().print("He llo... -
Help with Java & Regular Expression
Hello,
I have one line of Java and regular expression that I got from the web :
Code:String[] opt; opt = line.split("\\s+(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
1 "Hello World"
this code would give me :
opt[0] : 1
opt[1] : "Hello World"
which is almost what I would like to...Last edited by Niheel; Jul 18 '11, 10:17 PM. -
Hello Oralloy,
Thank you so much for your help.
I wonder if you could please tell me if the second solution you gave me would work if I run my JSP page and my Java application on a client side?
Thank you again,
AkinoLeave a comment:
No activity results to display
Show More
Leave a comment: