Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

5.pl i have another new example

by Raymond (Novice)
on Jul 29, 2013 at 23:09 UTC ( #1046930=note: print w/ replies, xml ) Need Help??


in reply to Re: a new example
in thread a new example

#!/usr/bin/perl use strict; use warnings; my $string = "This is what you have"; print $string; #this part does not print: substr($string, 5, 2) = "wasn't"; #change "is" to "wasn't" substr($string, -12) = "ondrous"; #"this wasn't wondrous" substr($string, 0, 1) = ""; #delete first character substr($string, -10) = ""; #delete last 10 characters #printing problem end here


Comment on 5.pl i have another new example
Download Code
Re: 5.pl i have another new example
by ww (Bishop) on Jul 30, 2013 at 00:41 UTC
    Uh... well, yeah, it is a new example of something.

    Please share the 'of what' as I can't see the relevance in a thread devoted to encoding/decoding utf8.

    Oh, yes. When I print the part you've labeled as non-printing, I see this:

    #!/usr/bin/perl use strict; use warnings; # 1046930 my $string = "This is what you have" . "\n";; print $string; #this part does not print: substr($string, 5, 2) = "wasn't"; #change "is" to "wasn't" print $string . "\n"; substr($string, -12) = "ondrous"; #"this wasn't wondrous" print $string . "\n"; substr($string, 0, 1) = ""; #delete first character print $string . "\n"; substr($string, -10) = ""; #delete last 10 characters print $string . "\n"; #printing problem end here =head out: This is what you have This wasn't what you have This wasn't whondrous his wasn't whondrous his wasn't =cut

    ...which is at some variance with what your comments suggest you expected.

    If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.
Re: 5.pl i have another new example
by kcott (Abbot) on Jul 30, 2013 at 05:34 UTC

    This makes no sense as a reply to what I wrote, nor does it make any sense in the context of this thread.

    If you'd care to clarify your intent, that would be good. :-)

    -- Ken

      Iam triyng to make a perl site, with examples, this is another one of the samples on perll cookbook and they don't work, and iam asking for help, this one was used on the wrong place, my apologies. Other think I bought a license of Mirc, and i can't use it because it was stolen electroniclly, I don't know were to ask for help, any ideas? I usally put my head intgo work when this thinks happen so:
      #!/usr/bin/perl use strict; use warnings; #extract column with unpack $a = "To be or not to be"; $b = unpack("x6 A6", $a); #skip 6, grab 6 print $b; ($b, $c) = unpack("x6 A2 x5 A2", $a); #forward 6, grab 2; backward 5 +, grab 2 print "$b\n$c\n";
      errors:

      Global symbol "$c" requires explicit package name at 7.pl line 10.

      Global symbol "$c" requires explicit package name at 7.pl line 11.

      Execution of 7.pl aborted due to compilation errors.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-09-15 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls