Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^5: Can I access and use UV types from perl?

by hippo (Bishop)
on Nov 17, 2019 at 23:48 UTC ( [id://11108844]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Can I access and use UV types from perl?
in thread Can I access and use UV types from perl?

The main sense I am getting from this, is that Perl is all about the storage.

My sense is that Perl is all about the DWIM. What I haven't seen so far (and apologies if I've missed it) is where your problem lies. Here's a simple example:

#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 1; my $x = 3; my $y = 2; is $x + $y, 5, 'Yes, your integers behave exactly as expected';

What else do you expect to happen?

Replies are listed 'Best First'.
Re^6: Can I access and use UV types from perl?
by Don Coyote (Hermit) on Nov 18, 2019 at 01:28 UTC

    well, and this may a little bit controversial, but...

    #!perl use strict; use warnings; use Test::More tests => 1; my $x = 5; my $y = 3; is $x / $y, undef, 'Yes, your integers behave exactly as expected'; =head1 output 1..1 not ok 1 - yes your integers behave as expected # Failed test 'yes your integers behave as expected' # at -e line 1. # got: '1.66666666666667' # expected: undef # Looks like you failed 1 test of 1. =cut

      This is what I would tend to expect (using integer):

      c:\@Work\Perl\monks>perl -le "use strict; use warnings; ;; use integer; ;; use Test::More tests => 2; ;; my $x = 5; my $y = 3; ;; is $x / $y, 1, qq{$x / $y == 1 is expected}; is $y / $x, 0, qq{$y / $x == 0 is expected}; " 1..2 ok 1 - 5 / 3 == 1 is expected ok 2 - 3 / 5 == 0 is expected


      Give a man a fish:  <%-{-{-{-<

        You got me here, the documentation for the pragma does describe that expected behaviour.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108844]
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-24 01:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found