Perl internally doesn't have different scalar types, all numbers are simply scalars. Depending on what you want, you could check if the number has a fractional part, or use a regular expression match.
The first condition will specifically require all numbers to have a digit, so "." doesn't evaluate to "0.0". If you want to change that, you could change the second regular expression. Perhaps it should be stricter and check that there is at most one decimal point, and that the sign comes before the numbers, if present. But hopefully this should at least get you going.
Hi all,
Can anyone tell me a little about the datatype FILE, which represents stream. What does its structure look like, and in which header file is it defined and so on...
Ex :
FILE *fp ;
fp = fopen("filename", "w") ; (6 Replies)
I am writing some code to do analysis on the file system (HP-UX 11.11).
I am using stat(..) to get file information. My problem is that the file-size may exceed the data types defined in 'sys/stat.h' & 'sys/types.h' respectively.
Thus file-sizes in the Giga-byte range are not read correctly.... (2 Replies)
Hello,
I get this message : "Value too large to be stored in data type" when I try to open a 3Gb file.
Can someone helps me to resolve the problem.
Thank you very much (5 Replies)
Hi everybody,
I`m very new with PHP and Databases and I having the follow issue with prices data..
The original information is in CSV files.
The prices have formatted with commas and dots as follow:
12,300.99 -->(thousands separated by commas)
3,500.25 -->(thousands separated... (10 Replies)
i'm using a C program and running it on a linux server, i got 2 adressess of 2 variables, and 2 addresses of 2 chars, and compared it. and got the size of a int and the size of a char.
why is a size of a int (4 bytes) bigger then the size of a char (1 byte)?
also if i do &a-&b i get 1, but if i... (30 Replies)
is there a way to do this through snmp?
i'm writing a shell script that will be run against several servers, but when i run the script, the most i get back from snmp is information that is simple.
the snmp in the script tells me if the box is linux or solaris. but it doesn't tell me the... (7 Replies)
This is from a program I wrote over in 1998 that I am trying to compile on a linux machine:
void write_line (FILE *fp, int rec_no, line_rec *arec)
{
fpos_t woffset;
woffset = (rec_no - 1) * sizeof(line_rec);
fsetpos(fp,&woffset);
fwrite(arec,sizeof(line_rec),1,fp);
}On the line... (2 Replies)
Discussion started by: wbport
2 Replies
LEARN ABOUT DEBIAN
moosex::types::perl
MooseX::Types::Perl(3pm) User Contributed Perl Documentation MooseX::Types::Perl(3pm)NAME
MooseX::Types::Perl - Moose types that check against Perl syntax
VERSION
version 0.101341
SYNOPSIS
use MooseX::Types::Perl qw(
DistName
ModuleName
PackageName
Identifier
SafeIdentifier
LaxVersionStr
StrictVersionStr
VersionObject
);
DESCRIPTION
This library provides Moose types for checking things (mostly strings) against syntax that is, or is a reasonable subset of, Perl syntax.
TYPES
ModuleName
PackageName
These types are identical, and expect a string that could be a package or module name. That's basically a bunch of identifiers stuck
together with double-colons. One key quirk is that parts of the package name after the first may begin with digits.
The use of an apostrophe as a package separator is not permitted.
DistName
The DistName type checks for a string like "MooseX-Types-Perl", the sort of thing used to name CPAN distributions. In general, it's like
the more familiar ModuleName, but with hyphens instead of double-colons.
In reality, a few distribution names may not match this pattern -- most famously, "CGI.pm" is the name of the distribution that contains
CGI. These exceptions are few and far between, and deciding what a "LaxDistName" type would look like has not seemed worth it, yet.
Identifier
An Identifier is something that could be used as a variable name. Generally, it's a bunch of alphanumeric characters not starting with a
digit.
Although Perl identifiers may contain non-ASCII characters in some circumstances, this type does not allow it. A "UnicodeIdentifier" type
may be added in the future.
SafeIdentifier
SafeIdentifiers are just like Identifiers, but omit the single-letter variables underscore, a, and b, as these have special significance.
LaxVersionStr
StrictVersionStr
Lax and strict version strings use the is_lax and is_strict methods from "version" to check if the given string would be a valid lax or
strict version. version::Internals covers the details but basically: lax versions are everything you may do, and strict omit many of the
usages best avoided.
VersionObject
Just for good measure, this type is included to check if a value is a version object. Coercions from LaxVersionStr (and thus
StrictVersionStr) are provided.
AUTHOR
Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2011-12-23 MooseX::Types::Perl(3pm)