User Profile

Collapse

Profile Sidebar

Collapse
Akino877
Akino877
Last Activity: Feb 1 '15, 10:15 PM
Joined: Nov 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Does Perl parse its code left-to-right or right-to-left?

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

  • Yes, I understand it now. Thank you.
    See more | Go to post

    Leave a comment:


  • Akino877
    replied to Does Perl Always Pass Argument By Reference?
    in Perl
    Hi Kelicula,

    Thank you very much for your reply.

    Akino
    See more | Go to post

    Leave a comment:


  • Akino877
    replied to Hash of Arrays
    in Perl
    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.

    Akino
    See more | Go to post

    Leave a comment:


  • Akino877
    started a topic Does Perl Always Pass Argument By Reference?
    in Perl

    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);
    Could someone please tell me if the second web page is correct?

    Thank you - Akino
    See more | Go to post

  • Akino877
    started a topic Hash of Arrays
    in Perl

    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] );
    In this code, each key is associated with a reference to an array.
    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:
    
    
    ...
    See more | Go to post

  • 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})|;
    I understand that the end result is that $a_month will get 1 or more digits; $a_day will get one or more digits; and $a_year will get 4 digits. But I would like to understand the meaning of 'm' and the vertical bars in this context.

    Could someone...
    See more | Go to post

  • Akino877
    started a topic (Perl/Regex) Match a Repeated Group of Characters
    in Perl

    (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+)/
    then $1 is correct ('akinot'), $2 is correct ('x:1240:1240:' ). But $3 is '1240:' instead of 'Tomeri'....
    See more | Go to post

  • Akino877
    started a topic Perl and Regular Expression Repetition
    in Perl

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

  • Akino877
    started a topic Insert Into a Binary Tree in Java
    in Java

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

  • Akino877
    started a topic Comparing 2 Strings Using >
    in Perl

    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";
    }
    And it printed "Not greater". I wonder if someone could please tell me why?

    Thank you so much for your help - Akino
    See more | Go to post

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

  • Perl/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".
    ...
    See more | Go to post

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

  • Hello C CSR,

    Thank you so much for your reply. Removing the extra " :

    Code:
    <option selected="true" value="<%=item%>"><%=item%></option>
    allows my code to work. But it adds an extra item to my drop down list. I wonder if you or someone could please tell me how to set
    the selected item on a drop down list without adding a new item to...
    See more | Go to post

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

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

  • Akino877
    started a topic How to get user input in a portlet?
    in Java

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

  • Akino877
    started a topic Help with Java & Regular Expression
    in Java

    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+(?=([^\"]*\"[^\"]*\")*[^\"]*$)");
    If "line" contains :
    1 "Hello World"

    this code would give me :
    opt[0] : 1
    opt[1] : "Hello World"


    which is almost what I would like to...
    See more | Go to post
    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,

    Akino
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...