Professional Web Applications Themes

The >> operator - PERL Beginners

Hi all, I'm not sure if ">>" is an official operator in Perl but I have seen ">>" used in conjunction with HTML code or Long Strings. a google search and perldoc doesn't return any useful information. I am looking for code examples that use ">>". TIA, -gohaku...

  1. #1

    Default The >> operator

    Hi all,
    I'm not sure if ">>" is an official operator in Perl but I have seen
    ">>" used in conjunction with
    HTML code or Long Strings.
    a google search and perldoc doesn't return any useful information.
    I am looking for code examples that use ">>".

    TIA,
    -gohaku

    Gohaku Guest

  2. #2

    Default Re: The >> operator

    On 5/29/2004 12:28 AM, gohaku wrote: 

    It has two uses: 1) the bitwise shift operator (see `perldoc perlop`),
    and 2) the use you describe is as a here-doent, a way of quoting long
    strings (see `perldoc perldata`, search for the term "here-doent").

    Randy.

    Randy Guest

  3. #3

    Default Re: The >> operator

    "Randy W. Sims" wrote: 
    >
    > It has two uses: 1) the bitwise shift operator (see `perldoc perlop`),
    > and 2) the use you describe is as a here-doent, a way of quoting long
    > strings (see `perldoc perldata`, search for the term "here-doent").[/ref]

    Oddly enough, unlike most other operators in Perl, >> has only one use,
    number 1 above. Here-docs use <<.


    John
    --
    use Perl;
    program
    fulfillment
    John Guest

  4. #4

    Default Re: The >> operator

    * gohaku <net> [2004-05-29T00:28:07] 

    Operators are doented in the "perlop" page of the doentation. Run
    "perldoc perlop" at your shell.

    Looking in there for ">>" will net this:

    Binary ">>" returns the value of its left argument shifted right by
    the number of bits specified by the right argument. Arguments should
    be integers. (See also "Integer Arithmetic".)

    --
    rjbs

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.7 (GNU/Linux)

    iD8DBQFAuHbq5IEwYcR13KMRAvi4AJ9QS+xx3TZ4Pa3qSmJMP5 E3jPcKyQCgghK8
    FfZtHLozsBo5UNhgcIQH21I=
    =xiAS
    -----END PGP SIGNATURE-----

    Ricardo Guest

  5. #5

    Default Re: The >> operator

    >>>>> "John" == John W Krahn <org> writes:

    John> Oddly enough, unlike most other operators in Perl, >> has only one use,
    John> number 1 above.

    Well, some people might consider open FOO, ">>bar" to be another "use"
    of ">>".

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <com> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Randal Guest

  6. #6

    Default Re: The >> operator

    "Randal L. Schwartz" wrote: [/ref]
    >
    > John> Oddly enough, unlike most other operators in Perl, >> has only one use,
    > John> number 1 above.
    >
    > Well, some people might consider open FOO, ">>bar" to be another "use"
    > of ">>".[/ref]

    Oh come on Randal! :-) Does that mean that printf('%s', 'string') is
    another use of the % operator, or that pack('a*', 'string') is another
    use of the * operator, or that $a = 'destructively' is another use of
    the tr, y, s, v and uc operators?


    John
    --
    use Perl;
    program
    fulfillment
    John Guest

Similar Threads

  1. operator
    By Gyger in forum PHP Development
    Replies: 3
    Last Post: August 18th, 07:18 AM
  2. |= Operator
    By osirishinzen in forum PHP Development
    Replies: 2
    Last Post: December 24th, 05:49 PM
  3. or operator
    By Paul Kraus in forum PERL Beginners
    Replies: 0
    Last Post: August 29th, 05:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139