gcc -B/usr/ccs/bin/ -c -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"3.14\" -DXS_VERSION=\"3.14\" -fPIC "-I/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE" Cwd.c In file included from /usr/local/lib/perl5/5.8.0/sun4-solaris/CORE/perl.h:2686, from Cwd.xs:2: /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.2.2/include/math.h:25:26: iso/math_iso.h: No such file or directory make: *** [Cwd.o] Error 1 #### Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=solaris, osvers=2.8, archname=sun4-solaris uname='sunos solaris 5.8 generic_108528-11 sun4u sparc sunw,ultra-5_10 ' config_args='-Dcc=gcc -B/usr/ccs/bin/' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc -B/usr/ccs/bin/', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O', cppflags='-fno-strict-aliasing' ccversion='', gccversion='3.1', gccosandvers='solaris2.8' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc -B/usr/ccs/bin/', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -lgdbm -ldl -lm -lc perllibs=-lsocket -lnsl -ldl -lm -lc libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' ' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under solaris Compiled at Jul 22 2002 02:55:19 @INC: /usr/local/lib/perl5/5.8.0/sun4-solaris /usr/local/lib/perl5/5.8.0 /usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl . #### #include #include #define SLEEP 100 /* Function prototype for the ctrl signal handler */ BOOL CtrlHandler( DWORD fdwCtrlType ); /* Currently global so we can set it in our ctrl-c handler to cleanly exit */ int exitflag = 0; int main() { HANDLE std_in; DWORD records_read = 0; DWORD i; LPDWORD old_mode; INPUT_RECORD buffer[128]; int sleep_time; /* Number of milliseconds to sleep */ sleep_time = SLEEP; /* Assign a handle to stdinput */ std_in = GetStdHandle(STD_INPUT_HANDLE); if (std_in == INVALID_HANDLE_VALUE) { printf("Could not get handle to stdin\n"); exit(EXIT_FAILURE); } /* Set ourselves able to receive input without a carriage return */ /* Backup the old mode */ if (! GetConsoleMode(std_in, &old_mode) ) { printf("Could not save old screen mode\n"); exit(EXIT_FAILURE); } /* We want to handle ctrl-c and disable all else */ SetConsoleMode(std_in, ENABLE_PROCESSED_INPUT); /* Register for ctrl-c */ if( SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, TRUE ) ) { /* Inifite loop - exits via the ctrl-c handler (way below) */ while(!exitflag) { GetNumberOfConsoleInputEvents(std_in, &records_read); if( records_read > 0) { /* We have events */ if( ReadConsoleInput(std_in, buffer, 128,&records_read) ) { for (i = 0; i < records_read; i++) { /* Do something with buffer[i] - print in this case */ if(buffer[i].Event.KeyEvent.bKeyDown) { if(buffer[i].Event.KeyEvent.wVirtualScanCode == 0x1c) { printf("\n"); } else { char c = buffer[i].Event.KeyEvent.uChar.AsciiChar; printf("%c", c); } } } } FlushConsoleInputBuffer(std_in); } else { } /* Preserve our cpu.*/ Sleep(sleep_time); } /* Do our shutdown processing here if need be. */ } else { printf( "\nERROR: Could not set control handler"); } /* Restore the old mode */ SetConsoleMode(std_in, old_mode); return 0; } /* Handle a ctrl event. Coded to handle ctrl-c only. */ BOOL CtrlHandler( DWORD fdwCtrlType ) { switch( fdwCtrlType ) { // Handle the CTRL-C signal. case CTRL_C_EVENT: /* We want to exit cleanly */ exitflag = 1; return( TRUE ); default: return FALSE; } } #### #include /* General program actions. */ void func_one(); void func_two(); void func_three(); /* Sets up the despatch table */ voi d setup( void (*despatch[3])()); int main() { /* Declare and setup the despatch table */ void (*despatch[3])(void) = {NULL}; setup(despatch); /* Call the second program action */ (*despatch[1])(); return 0; } void setup( void (*despatch[3])()) { despatch[0] = &func_one; despatch[1] = &func_two; despatch[2] = &func_three; } void func_one() { printf("Program action one\n"); } void func_two() { printf("Program action two\n"); } void func_three() { printf("Program action three\n"); } #### select tsa1.ticket_ID, ts1.name, tsa1.date_updated as date_opened, (select min(date_updated) from TICKET_STATE_AUDIT where date_updated >= tsa1.date_updated and ticket_ID = tsa1.ticket_ID and state_ID = (select ID from TICKET_STATE where name = 'closed')) from TICKET_STATE_AUDIT as tsa1 left join TICKET_STATE as ts1 on tsa1.state_ID = ts1.ID where tsa1.ticket_ID = 4 and tsa1.state_ID = (select ID from TICKET_STATE where name = 'open') #### use strict; my $input = "[http://forum1.reith.bbc.co.uk/cgi-perl/h2/h2.cgi|title]"; my $nasty_input = "[http://\nforum1.\nreith.bbc.co.uk/cgi-perl\n/h2/h2.cgi|title]"; my $garbage = "blahblabhladas sdfgsdgf.\ndsfg\n\t\tsdfxsdf\n\tasf"; my $poo = join('', reverse( split(//, $garbage) )); my $final_input = $nasty_input . $garbage . $input . $poo . $garbage . $poo . $input . $garbage . $nasty_input; print $final_input,"\n"; # This assumes that the delimiters surround our urls. # The next step would be to pass $string to something like URI to test if it # is a valid url. Either that or to URI::Find to see if there is a sub url in there. # Though I think URI::Find wouldn't like the |title stuff on the end. while($final_input =~ /\[(.*?)\]/sgc) { my $string = $1; if($string =~ /\n\r?/sg) { $string =~ s/\n\r?//sg; } print $string,"\n"; } #### use strict; use Win32; use Win32::Console::ANSI; use Term::ANSIColor; my @colours = ( 'bold blue', 'bold blink yellow', 'red', 'white', 'green', 'cyan', 'magenta', 'bold red' ); my $list = make_list(12, @colours); #print join("\t", @{$list}); print "\n"; foreach my $colour (@{$list}) { print colored ("*", $colours[$colour]); print "\r"; sleep(1); } sub make_list { my ($size, @cols) = @_; unless(defined($size) || $size <= 0) { $size = $#cols; } # We need to grab all the possible numbers from # our colours, shuffle those and then pick the # first 'size' list. To avoid having a repeated # pattern, we reshuffle the list after we reach # a potential period point. my @copy = qw(0 1 2 3 4 5 6 7); shuffle(\@copy); my @array; my $j = 0; for(my $i = 0; $i < $size; $i++) { push @array, $copy[$j]; $j++; if(($j % $#cols) == 0) { # Reshuffle $j = 0; @copy = qw(0 1 2 3 4 5 6 7); shuffle(\@copy); } } return \@array; } # The Fisher-Yates Shuffle - taken from node 30243 sub shuffle { my $arrayref = shift; my $i = @$arrayref; while ( $i-- ) { my $newloc = int rand (1+$i); # next if $index == $newloc; # Not needed in Perl. @$arrayref[$i, $newloc] = @$arrayref[$newloc, $i]; } } #### privname module flag test test 0 vest test 0 test bob 1 vest bob 0 #### select apm.admin_ID, flag = case when apm.priv_ID is null then 0 else 1 end, apm.module_ID, p.name, m.module from ADMIN as a join APM_LINK as apm on a.ID = apm.admin_ID and a.firstname = 'simon' right join PRIVS as p on p.ID = apm.priv_ID left join MODULES as m on apm.module_ID = m.ID #### adminID flag moduleID name module NULL 0 NULL create NULL NULL 0 NULL update NULL NULL 0 NULL delete NULL 1 1 1 super news 1 1 2 super directory #### select flag = case when apm.admin_ID is null then 0 else 1 end, --m.ID as "module id", m.module, --p.ID as "priv id", p.name as "priv" from MODULES as m cross join PRIVS as p left join APM_LINK as apm on apm.module_ID = m.ID and apm.priv_ID = p.ID and apm.admin_ID = (select ID from ADMIN where firstname = 'simon') order by m.module